diff --git a/djangoldp_tzcld/admin.py b/djangoldp_tzcld/admin.py index 23a6423a7733c3b0cd0068853d5c29838ff57625..c693a6611acbcfbaf7467ff47a39d6333c727722 100644 --- a/djangoldp_tzcld/admin.py +++ b/djangoldp_tzcld/admin.py @@ -1,7 +1,6 @@ from django.contrib import admin from djangoldp.admin import DjangoLDPAdmin from djangoldp.models import Model -#from djangoldp_tzcld.models import TzcldProfile, TzcldCommunity, TzcldTerritoriesKind, TzcldProfileOrganisation, TzcldProfileEvent, TzcldProfileRegion from djangoldp_tzcld.models import TzcldProfile, TzcldCommunity, TzcldTerritoriesKind, TzcldCommunityFollowedPointPart, TzcldCommunityFollowedPoint, TzcldCommunityEvaluationPointPart, TzcldCommunityEvaluationPoint, TzcldTerritoryRegion, TzcldProfileJob, TzcldTerritoryLocation diff --git a/djangoldp_tzcld/migrations/0001_initial.py b/djangoldp_tzcld/migrations/0001_initial.py index c72a40498a70e743f4c21ad353f096c7037d1954..6f23f648862d8cf77fe361b9abe2e2bd3b0fd7d7 100644 --- a/djangoldp_tzcld/migrations/0001_initial.py +++ b/djangoldp_tzcld/migrations/0001_initial.py @@ -4,7 +4,6 @@ from django.conf import settings from django.db import migrations, models import django.db.models.deletion import djangoldp.fields -import djangoldp_tzcld.permissions class Migration(migrations.Migration): @@ -36,8 +35,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldProfile', @@ -66,13 +64,9 @@ class Migration(migrations.Migration): 'rdf_type': 'sib:CommunityTzcldProfile', 'auto_author': 'user', 'container_path': '/tzcldprofiles/', - 'permission_classes': [djangoldp_tzcld.permissions.TzcldCommunityProfilePermissions], 'serializer_fields': ['@id', 'contact_first_name', 'contact_last_name', 'kind', 'features', 'region', 'contact_mail_1', 'contact_mail_2', 'contact_mail_3', 'membership', 'last_contribution_year'], 'depth': 1, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), migrations.CreateModel( name='TzcldProfileOrganisation', @@ -94,8 +88,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldProfileEvent', @@ -117,8 +110,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldCommunity', @@ -147,12 +139,9 @@ class Migration(migrations.Migration): 'default_permissions': ['add', 'change', 'delete', 'view', 'control'], 'rdf_type': 'sib:CommunityTzcldProfile', 'container_path': '/tzcldprofiles/', - 'permission_classes': [djangoldp_tzcld.permissions.TzcldCommunityProfilePermissions], + 'serializer_fields': ['@id', 'contact_first_name', 'contact_last_name', 'kind', 'features', 'region', 'contact_mail_1', 'contact_mail_2', 'contact_mail_3', 'membership', 'last_contribution_year'], 'depth': 1, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'add'], - 'superuser_perms': ['view'], - }, + }, ), ] diff --git a/djangoldp_tzcld/migrations/0003_auto_20220720_1242.py b/djangoldp_tzcld/migrations/0003_auto_20220720_1242.py index 9b21d2f70d30cc826b19d74adb7387d30aeeafef..7ae05b74681f82bf40088f1e9351f8f9115b587c 100644 --- a/djangoldp_tzcld/migrations/0003_auto_20220720_1242.py +++ b/djangoldp_tzcld/migrations/0003_auto_20220720_1242.py @@ -35,7 +35,6 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), ] diff --git a/djangoldp_tzcld/migrations/0004_tzcldprofilejob_tzcldprofilejobemail_tzcldprofilejobphone.py b/djangoldp_tzcld/migrations/0004_tzcldprofilejob_tzcldprofilejobemail_tzcldprofilejobphone.py index c38076023a66a2a6ebfc1c3ff2f05b8ae41f9991..ceb458a87d94125a396c105cb7af0f8e24c214a0 100644 --- a/djangoldp_tzcld/migrations/0004_tzcldprofilejob_tzcldprofilejobemail_tzcldprofilejobphone.py +++ b/djangoldp_tzcld/migrations/0004_tzcldprofilejob_tzcldprofilejobemail_tzcldprofilejobphone.py @@ -37,10 +37,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'position', 'organistion', 'address', 'postal_code', 'city', 'departement', 'address_public'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), migrations.CreateModel( name='TzcldProfileJobPhone', @@ -64,10 +61,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'phone', 'phone_type', 'phone_public'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), migrations.CreateModel( name='TzcldProfileJobEmail', @@ -91,9 +85,6 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'email', 'email_type', 'email_public'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), ] diff --git a/djangoldp_tzcld/migrations/0006_auto_20230327_1449.py b/djangoldp_tzcld/migrations/0006_auto_20230327_1449.py index 225d71a81d31422f0b5f9b2f9056df1ce3ceccd3..400e0c5b5f5b69df057ad3df3e7b52cf72ff61ef 100644 --- a/djangoldp_tzcld/migrations/0006_auto_20230327_1449.py +++ b/djangoldp_tzcld/migrations/0006_auto_20230327_1449.py @@ -33,10 +33,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'email', 'email_type', 'email_public'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), migrations.CreateModel( name='TzcldContactPhone', @@ -59,10 +56,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'phone', 'phone_type', 'phone_public'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), migrations.CreateModel( name='TzcldJobsEmails', @@ -106,10 +100,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['view'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoriesEmails', @@ -149,8 +140,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoryLocation', @@ -179,10 +169,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-territories-location/', 'serializer_fields': ['@id', 'name', 'address', 'postal_code', 'city', 'departement', 'link', 'twitter_link', 'linkedin_link', 'phones', 'emails'], 'nested_fields': [], - 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'view', 'add', 'change'], - 'superuser_perms': ['inherit', 'change'], + 'depth': 0 }, ), migrations.CreateModel( @@ -204,8 +191,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.RemoveField( model_name='tzcldprofilejobemail', diff --git a/djangoldp_tzcld/migrations/0015_auto_20230330_1439.py b/djangoldp_tzcld/migrations/0015_auto_20230330_1439.py index 08e32b20e22d02a070b2657eb7ffae4b7e2d6eb0..5417481b2280560eba10f4a383f1c7e774b0ad27 100644 --- a/djangoldp_tzcld/migrations/0015_auto_20230330_1439.py +++ b/djangoldp_tzcld/migrations/0015_auto_20230330_1439.py @@ -31,8 +31,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.AddField( model_name='tzcldcommunity', diff --git a/djangoldp_tzcld/migrations/0016_tzcldcontactmember.py b/djangoldp_tzcld/migrations/0016_tzcldcontactmember.py index bfbc9be55b6e64a12704d24ca3386bc6a3566331..8da20b3ccbaa3379397a9c9940240763b0e387a8 100644 --- a/djangoldp_tzcld/migrations/0016_tzcldcontactmember.py +++ b/djangoldp_tzcld/migrations/0016_tzcldcontactmember.py @@ -33,9 +33,6 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'member', 'is_primary'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['view'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), ] diff --git a/djangoldp_tzcld/migrations/0023_auto_20230524_1456.py b/djangoldp_tzcld/migrations/0023_auto_20230524_1456.py index 7fe266c9aa8b63c98f0b6956b8583f4244c05742..f4b4eea67d1db2356a8ad7c0f797c9aa2b1da7c1 100644 --- a/djangoldp_tzcld/migrations/0023_auto_20230524_1456.py +++ b/djangoldp_tzcld/migrations/0023_auto_20230524_1456.py @@ -3,7 +3,6 @@ from django.db import migrations, models import django.db.models.deletion import djangoldp.fields -import djangoldp_tzcld.permissions class Migration(migrations.Migration): @@ -33,8 +32,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldCommunityEvaluationPoint', @@ -55,13 +53,10 @@ class Migration(migrations.Migration): 'default_permissions': ['add', 'change', 'delete', 'view', 'control'], 'rdf_type': 'tzcld:communityEvaluationPoint', 'container_path': '/tzcld-communities-evaluation-points/', - 'permission_classes': [djangoldp_tzcld.permissions.TzcldCommunityProfilePermissions], + 'serializer_fields': ['@id', 'name', 'order', 'part', 'points'], 'depth': 1, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'add'], - 'superuser_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldCommunityEvaluationPointPart', @@ -86,8 +81,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name', 'title', 'subtitle', 'order'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldCouncilDepartmentDeliberation', @@ -108,8 +102,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldOtherCommunityDeliberation', @@ -130,8 +123,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.RemoveField( model_name='tzcldterritorylocation', @@ -168,13 +160,10 @@ class Migration(migrations.Migration): 'default_permissions': ['add', 'change', 'delete', 'view', 'control'], 'rdf_type': 'tzcld:communityEvaluationPointAnswer', 'container_path': '/tzcld-communities-evaluation-point-answers/', - 'permission_classes': [djangoldp_tzcld.permissions.TzcldCommunityProfilePermissions], + 'serializer_fields': ['@id', 'answer', 'comment', 'evaluation_point', 'community'], 'depth': 1, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'add'], - 'superuser_perms': ['view'], - }, + }, ), migrations.AddField( model_name='tzcldcommunityevaluationpoint', diff --git a/djangoldp_tzcld/migrations/0028_tzcldsharednote_tzcldsharednotecomment.py b/djangoldp_tzcld/migrations/0028_tzcldsharednote_tzcldsharednotecomment.py index 53b9d0221c0781675b63503a2eab3ff23cf00695..25d21e102d99eefc4d0e75cc1bde1786a5db93f5 100644 --- a/djangoldp_tzcld/migrations/0028_tzcldsharednote_tzcldsharednotecomment.py +++ b/djangoldp_tzcld/migrations/0028_tzcldsharednote_tzcldsharednotecomment.py @@ -35,10 +35,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'user', 'longdesc', 'tzcldCommunity'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['view'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), migrations.CreateModel( name='TzcldSharedNoteComment', @@ -61,9 +58,6 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'user', 'comment', 'tzcldSharedNote'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['view'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), ] diff --git a/djangoldp_tzcld/migrations/0029_tzcldterritoryrequest.py b/djangoldp_tzcld/migrations/0029_tzcldterritoryrequest.py index 0ca72d86545cd2b986700632eca55573e0208c36..9ece01997b6065a0853bc8085071a5373c63cfbe 100644 --- a/djangoldp_tzcld/migrations/0029_tzcldterritoryrequest.py +++ b/djangoldp_tzcld/migrations/0029_tzcldterritoryrequest.py @@ -39,9 +39,6 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'user', 'date', 'contactType', 'subject', 'comment', 'community'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['view'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), ] diff --git a/djangoldp_tzcld/migrations/0030_tzcldfollowedtrainingb_tzcldfollowedtrainingd_tzcldterritorysynthesisfollowed.py b/djangoldp_tzcld/migrations/0030_tzcldfollowedtrainingb_tzcldfollowedtrainingd_tzcldterritorysynthesisfollowed.py index c941c413f0b5dc1a691fde16c385d40e84d66075..85af12561803c206bfb6c64509f9c34810043a3a 100644 --- a/djangoldp_tzcld/migrations/0030_tzcldfollowedtrainingb_tzcldfollowedtrainingd_tzcldterritorysynthesisfollowed.py +++ b/djangoldp_tzcld/migrations/0030_tzcldfollowedtrainingb_tzcldfollowedtrainingd_tzcldterritorysynthesisfollowed.py @@ -32,8 +32,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldFollowedTrainingD', @@ -54,8 +53,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritorySynthesisFollowed', @@ -85,9 +83,6 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'context', 'strongPoints', 'questions', 'needs', 'targetdate', 'followedTrainingB', 'followedTrainingBNumber', 'followedTrainingD', 'followedTrainingDNumber', 'community'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['view'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), ] diff --git a/djangoldp_tzcld/migrations/0031_auto_20230706_1124.py b/djangoldp_tzcld/migrations/0031_auto_20230706_1124.py index a83cdb0be458a12c05f0fe20b8e9fa0ed28e3c39..220c2e18829ff5b1314c2276ef4a75e59dd94d8c 100644 --- a/djangoldp_tzcld/migrations/0031_auto_20230706_1124.py +++ b/djangoldp_tzcld/migrations/0031_auto_20230706_1124.py @@ -3,7 +3,6 @@ from django.db import migrations, models import django.db.models.deletion import djangoldp.fields -import djangoldp_tzcld.permissions class Migration(migrations.Migration): @@ -36,10 +35,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-communities-followed-points/', 'serializer_fields': ['@id', 'name', 'order', 'part', 'fieldType', 'helpComment'], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'add'], - 'superuser_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldCommunityFollowedPointPart', @@ -63,10 +59,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name', 'title', 'order', 'followed_part_points'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'add'], - 'superuser_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldCommunityFollowedPointAnswer', @@ -86,13 +79,9 @@ class Migration(migrations.Migration): 'default_permissions': ['add', 'change', 'delete', 'view', 'control'], 'rdf_type': 'tzcld:communityEvaluationPointAnswer', 'container_path': 'tzcld-communities-evaluation-point-answers/', - 'permission_classes': [djangoldp_tzcld.permissions.TzcldCommunityProfilePermissions], 'serializer_fields': ['@id', 'answer', 'answer_option', 'comment', 'evaluation_point', 'community'], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'add'], - 'superuser_perms': ['view'], - }, + }, ), migrations.AddField( model_name='tzcldcommunityfollowedpoint', diff --git a/djangoldp_tzcld/migrations/0033_auto_20230710_1223.py b/djangoldp_tzcld/migrations/0033_auto_20230710_1223.py index a720e0b2a2b3231e6b5cbc5fbf1b950b275ee427..c678830325a09010c8644747bf61b57681b790fa 100644 --- a/djangoldp_tzcld/migrations/0033_auto_20230710_1223.py +++ b/djangoldp_tzcld/migrations/0033_auto_20230710_1223.py @@ -3,7 +3,6 @@ from django.db import migrations, models import django.db.models.deletion import djangoldp.fields -import djangoldp_tzcld.permissions class Migration(migrations.Migration): @@ -36,13 +35,9 @@ class Migration(migrations.Migration): 'default_permissions': ['add', 'change', 'delete', 'view', 'control'], 'rdf_type': 'tzcld:communityIdentity', 'container_path': 'tzcld-communities-identity/', - 'permission_classes': [djangoldp_tzcld.permissions.TzcldCommunityProfilePermissions], 'serializer_fields': ['@id', 'community', 'deputy', 'circonscription', 'origin_mobilization', 'application_date', 'signatory_structure', 'birth_date', 'last_contribution_date'], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'add'], - 'superuser_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoriesOriginMobilization', @@ -63,8 +58,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoriesTeamTrainingCourse', @@ -85,8 +79,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoriesTeamTrainingPromotoion', @@ -107,8 +100,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoriesTrainingCourse', @@ -129,8 +121,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoriesTrainingProfile', @@ -151,8 +142,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoriesTrainingPromotoion', @@ -173,8 +163,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'name'], 'nested_fields': [], 'depth': 0, - 'anonymous_perms': ['view'], - }, + }, ), migrations.CreateModel( name='TzcldTerritoryTraining', @@ -198,10 +187,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-territories-training/', 'serializer_fields': ['@id', 'training_course', 'training_promotoion', 'training_person', 'training_profile', 'community_identity'], 'nested_fields': ['community_identity'], - 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'view', 'add', 'change'], - 'superuser_perms': ['inherit', 'view', 'add', 'change'], + 'depth': 0 }, ), migrations.CreateModel( @@ -225,10 +211,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-territories-team-training/', 'serializer_fields': ['@id', 'training_course', 'training_promotoion', 'training_person', 'training_profile', 'community_identity'], 'nested_fields': ['community_identity'], - 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'view', 'add', 'change'], - 'superuser_perms': ['inherit', 'view', 'add', 'change'], + 'depth': 0 }, ), migrations.CreateModel( @@ -253,10 +236,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-territories-project-team-memeber/', 'serializer_fields': ['@id', 'firstname', 'name', 'etp', 'position_funding', 'community_identity'], 'nested_fields': ['community_identity'], - 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['inherit', 'view', 'add', 'change'], - 'superuser_perms': ['inherit', 'view', 'add', 'change'], + 'depth': 0 }, ), migrations.AddField( diff --git a/djangoldp_tzcld/migrations/0039_auto_20230711_1502.py b/djangoldp_tzcld/migrations/0039_auto_20230711_1502.py index 0cabc016678c403fb2718622683fbf0e7ef779df..a0b9dfdc16cd190f9e22c33e865cdeeebd9b1eaf 100644 --- a/djangoldp_tzcld/migrations/0039_auto_20230711_1502.py +++ b/djangoldp_tzcld/migrations/0039_auto_20230711_1502.py @@ -40,10 +40,7 @@ class Migration(migrations.Migration): 'serializer_fields': ['@id', 'author', 'name', 'date', 'document', 'community', 'visible'], 'nested_fields': ['author', 'community'], 'depth': 0, - 'anonymous_perms': ['view'], - 'authenticated_perms': ['view'], - 'superuser_perms': ['inherit', 'change'], - }, + }, ), migrations.AddField( model_name='tzcldprofile', diff --git a/djangoldp_tzcld/migrations/0053_auto_20231006_1300.py b/djangoldp_tzcld/migrations/0053_auto_20231006_1300.py index bc6c82dd8c623cebc22e1c9499dea0b3375936e3..e6c82e749af0c9c4cccebb9a96aea54dc4947c42 100644 --- a/djangoldp_tzcld/migrations/0053_auto_20231006_1300.py +++ b/djangoldp_tzcld/migrations/0053_auto_20231006_1300.py @@ -39,11 +39,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-territory-shared-notes/', 'serializer_fields': ['@id', 'author', 'longdesc', 'communityAdmins', 'communityReferents', 'conversations', 'date'], 'nested_fields': ['author', 'communityAdmins', 'communityReferents', 'conversations'], - 'depth': 0, - 'anonymous_perms': [], - 'authenticated_perms': ['view', 'add'], - 'owner_perms': ['inherit', 'change', 'delete'], - 'superuser_perms': ['inherit'], + 'depth': 0 }, ), migrations.DeleteModel( diff --git a/djangoldp_tzcld/migrations/0059_tzcldterritoriesteamuserstate_and_more.py b/djangoldp_tzcld/migrations/0059_tzcldterritoriesteamuserstate_and_more.py index b31d18c4ca6cf88f3558ae9acde3db8a5203d8c9..e5251c870d9e87ea02e7534f165f34be56d2a702 100644 --- a/djangoldp_tzcld/migrations/0059_tzcldterritoriesteamuserstate_and_more.py +++ b/djangoldp_tzcld/migrations/0059_tzcldterritoriesteamuserstate_and_more.py @@ -34,11 +34,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-team-user-states/', 'serializer_fields': ['@id', 'name', 'order'], 'nested_fields': [], - 'depth': 0, - 'anonymous_perms': [], - 'authenticated_perms': ['view'], - 'owner_perms': ['inherit'], - 'superuser_perms': ['inherit'], + 'depth': 0 }, ), migrations.RenameField( @@ -97,11 +93,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-territories-political-landscape-senator/', 'serializer_fields': ['@id', 'senator', 'circonscription', 'community_identity'], 'nested_fields': ['community_identity'], - 'depth': 0, - 'anonymous_perms': [], - 'authenticated_perms': ['view', 'add'], - 'owner_perms': ['inherit', 'change', 'delete'], - 'superuser_perms': ['inherit'], + 'depth': 0 }, ), migrations.CreateModel( @@ -124,11 +116,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-territories-political-landscape-deputy/', 'serializer_fields': ['@id', 'deputy', 'circonscription', 'community_identity'], 'nested_fields': ['community_identity'], - 'depth': 0, - 'anonymous_perms': [], - 'authenticated_perms': ['view', 'add'], - 'owner_perms': ['inherit', 'change', 'delete'], - 'superuser_perms': ['inherit'], + 'depth': 0 }, ), migrations.AddField( diff --git a/djangoldp_tzcld/migrations/0061_tzcldterritorycirconscription_and_more.py b/djangoldp_tzcld/migrations/0061_tzcldterritorycirconscription_and_more.py index 0bdda98c36cd3e41d1997059205328ea7a06e274..9c1379006afb286ce8afa03501ddaa3e87e04765 100644 --- a/djangoldp_tzcld/migrations/0061_tzcldterritorycirconscription_and_more.py +++ b/djangoldp_tzcld/migrations/0061_tzcldterritorycirconscription_and_more.py @@ -31,11 +31,7 @@ class Migration(migrations.Migration): 'container_path': 'tzcld-circonscriptions/', 'serializer_fields': ['@id', 'name', 'order'], 'nested_fields': [], - 'depth': 0, - 'anonymous_perms': [], - 'authenticated_perms': ['view'], - 'owner_perms': ['inherit', 'add', 'change', 'delete'], - 'superuser_perms': ['inherit', 'change', 'delete'], + 'depth': 0 }, ), migrations.AlterModelOptions( diff --git a/djangoldp_tzcld/migrations/0064_alter_tzcldcommunity_options_and_more.py b/djangoldp_tzcld/migrations/0064_alter_tzcldcommunity_options_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..a46f0799ffdd6289c5d44ff8f514e785b566ee69 --- /dev/null +++ b/djangoldp_tzcld/migrations/0064_alter_tzcldcommunity_options_and_more.py @@ -0,0 +1,320 @@ +# Generated by Django 4.2.8 on 2023-12-14 13:59 + +from django.db import migrations +import djangoldp.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangoldp_tzcld', '0063_remove_tzcldterritorypoliticallandscapedeputy_circonscriptions_and_more'), + ] + + operations = [ + migrations.AlterModelOptions( + name='tzcldcommunity', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['community'], 'verbose_name': 'TZCLD Territory Profile', 'verbose_name_plural': 'TZCLD Territories Profiles'}, + ), + migrations.AlterModelOptions( + name='tzcldcommunitydeliberation', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory deliberation', 'verbose_name_plural': 'TZCLD Options Territories deliberations'}, + ), + migrations.AlterModelOptions( + name='tzcldcommunityevaluationpoint', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['order'], 'verbose_name': 'TZCLD Territory Evaluation Point', 'verbose_name_plural': 'TZCLD Territories Evaluation Points'}, + ), + migrations.AlterModelOptions( + name='tzcldcommunityevaluationpointanswer', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Evaluation Point Answer', 'verbose_name_plural': 'TZCLD Territories Evaluation Point answers'}, + ), + migrations.AlterModelOptions( + name='tzcldcommunityevaluationpointpart', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['order'], 'verbose_name': 'TZCLD Territory Evaluation Point Part', 'verbose_name_plural': 'TZCLD Territories Evaluation Point Parts'}, + ), + migrations.AlterModelOptions( + name='tzcldcommunityfollowedpoint', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['order'], 'verbose_name': 'TZCLD Territory Followed Point', 'verbose_name_plural': 'TZCLD Territories Followed Points'}, + ), + migrations.AlterModelOptions( + name='tzcldcommunityfollowedpointanswer', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Followed Point Answer', 'verbose_name_plural': 'TZCLD Territories Followed Point answers'}, + ), + migrations.AlterModelOptions( + name='tzcldcommunityfollowedpointpart', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['order'], 'verbose_name': 'TZCLD Territory Followed Point Part', 'verbose_name_plural': 'TZCLD Territories Followed Point Parts'}, + ), + migrations.AlterModelOptions( + name='tzcldcommunityidentity', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['community'], 'verbose_name': 'TZCLD Territory Identity', 'verbose_name_plural': 'TZCLD Territories Identities'}, + ), + migrations.AlterModelOptions( + name='tzcldcontactemail', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Email', 'verbose_name_plural': 'TZCLD Emails'}, + ), + migrations.AlterModelOptions( + name='tzcldcontactphone', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Phone', 'verbose_name_plural': 'TZCLD Phones'}, + ), + migrations.AlterModelOptions( + name='tzcldcouncildepartmentdeliberation', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Council department deliberation', 'verbose_name_plural': 'TZCLD Options Council department deliberations'}, + ), + migrations.AlterModelOptions( + name='tzcldothercommunitydeliberation', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Other Territory deliberation', 'verbose_name_plural': 'TZCLD Options Other Community deliberations'}, + ), + migrations.AlterModelOptions( + name='tzcldprofile', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['user'], 'verbose_name': 'TZCLD User Profile', 'verbose_name_plural': 'TZCLD Users Profiles'}, + ), + migrations.AlterModelOptions( + name='tzcldprofilejob', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD User profile job', 'verbose_name_plural': 'TZCLD Users profiles jobs'}, + ), + migrations.AlterModelOptions( + name='tzcldprofilesmembership', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Membership type', 'verbose_name_plural': 'TZCLD Options Membership types'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorieskind', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Kind', 'verbose_name_plural': 'TZCLD Options Territories Kind'}, + ), + migrations.AlterModelOptions( + name='tzcldterritoriesoriginmobilization', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Origin Mobilization', 'verbose_name_plural': 'TZCLD Options Origins Mobilization'}, + ), + migrations.AlterModelOptions( + name='tzcldterritoriesstepstate', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory step state', 'verbose_name_plural': 'TZCLD Options Territories step states'}, + ), + migrations.AlterModelOptions( + name='tzcldterritoriesteamuserstate', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['order'], 'verbose_name': 'TZCLD Team User State', 'verbose_name_plural': 'TZCLD Options Team User States'}, + ), + migrations.AlterModelOptions( + name='tzcldterritoriestrainingcourse', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Training Course', 'verbose_name_plural': 'TZCLD Options Training Courses'}, + ), + migrations.AlterModelOptions( + name='tzcldterritoriestrainingpromotion', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Training Promotion', 'verbose_name_plural': 'TZCLD Options Training Promotions'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorycirconscription', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['order'], 'verbose_name': 'TZCLD Circonscription', 'verbose_name_plural': 'TZCLD Options Circonscriptions'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorydepartment', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['name'], 'verbose_name': 'TZCLD Department', 'verbose_name_plural': 'TZCLD Options Departments'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorylocation', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory location', 'verbose_name_plural': 'TZCLD Territories locations'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorypoliticallandscapedeputy', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Political Landscape Deputy', 'verbose_name_plural': 'TZCLD Territories Political Landscape Deputies'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorypoliticallandscapesenator', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Political Landscape Senator', 'verbose_name_plural': 'TZCLD Territories Political Landscape Senators'}, + ), + migrations.AlterModelOptions( + name='tzcldterritoryprojectteammember', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Project Team Member', 'verbose_name_plural': 'TZCLD Territories Project Team Members'}, + ), + migrations.AlterModelOptions( + name='tzcldterritoryregion', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'ordering': ['name'], 'verbose_name': 'TZCLD Région', 'verbose_name_plural': 'TZCLD Régions'}, + ), + migrations.AlterModelOptions( + name='tzcldterritoryrequest', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Request', 'verbose_name_plural': 'TZCLD Territories Requests'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorysharedfile', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Shared File', 'verbose_name_plural': 'TZCLD Territories Shared Files'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorysharednote', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Shared Note', 'verbose_name_plural': 'TZCLD Territories Shared Notes'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorysynthesisfollowed', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Synthesis Followed', 'verbose_name_plural': 'TZCLD Territories Synthesis Followed'}, + ), + migrations.AlterModelOptions( + name='tzcldterritorytraining', + options={'default_permissions': {'control', 'add', 'view', 'change', 'delete'}, 'verbose_name': 'TZCLD Territory Training', 'verbose_name_plural': 'TZCLD Territories Trainings'}, + ), + migrations.AlterField( + model_name='tzcldcommunity', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcommunitydeliberation', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcommunityevaluationpoint', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcommunityevaluationpointanswer', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcommunityevaluationpointpart', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcommunityfollowedpoint', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcommunityfollowedpointanswer', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcommunityfollowedpointpart', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcommunityidentity', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcontactemail', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcontactphone', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldcouncildepartmentdeliberation', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldothercommunitydeliberation', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldprofile', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldprofilejob', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldprofilesmembership', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorieskind', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritoriesoriginmobilization', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritoriesstepstate', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritoriesteamuserstate', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritoriestrainingcourse', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritoriestrainingpromotion', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorycirconscription', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorydepartment', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorylocation', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorypoliticallandscapedeputy', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorypoliticallandscapesenator', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritoryprojectteammember', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritoryregion', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritoryrequest', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorysharedfile', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorysharednote', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorysynthesisfollowed', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + migrations.AlterField( + model_name='tzcldterritorytraining', + name='urlid', + field=djangoldp.fields.LDPUrlField(blank=True, db_index=True, null=True, unique=True), + ), + ] diff --git a/djangoldp_tzcld/models.py b/djangoldp_tzcld/models.py index 2dab2e34653a885e2069f50d70451deea5313d8a..886292082ccf8c04e0a9905194477915276c01d1 100644 --- a/djangoldp_tzcld/models.py +++ b/djangoldp_tzcld/models.py @@ -8,7 +8,6 @@ from django.utils.translation import gettext_lazy as _ from djangoldp.models import Model from djangoldp_conversation.models import Conversation, Message from djangoldp_community.models import Community, CommunityMember -from djangoldp_tzcld.permissions import TzcldCommunityProfilePermissions ############################# # Extend user model @@ -27,10 +26,10 @@ class TzcldTerritoryCirconscription(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Circonscription') verbose_name_plural = _("TZCLD Options Circonscriptions") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit', 'add', 'change', 'delete'] - superuser_perms = ['inherit', 'change', 'delete'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit', 'add', 'change', 'delete'] + # superuser_perms = ['inherit', 'change', 'delete'] container_path = "tzcld-circonscriptions/" serializer_fields = ['@id', 'name', 'order'] ordering = ['order'] @@ -50,10 +49,10 @@ class TzcldTerritoryDepartment(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Department') verbose_name_plural = _("TZCLD Options Departments") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit', 'add', 'change', 'delete'] - superuser_perms = ['inherit', 'change', 'delete'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit', 'add', 'change', 'delete'] + # superuser_perms = ['inherit', 'change', 'delete'] container_path = "tzcld-departments/" serializer_fields = ['@id', 'name', 'job_department'] ordering = ['name'] @@ -73,10 +72,10 @@ class TzcldTerritoryRegion(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Région') verbose_name_plural = _("TZCLD Régions") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit', 'add', 'change', 'delete'] - superuser_perms = ['inherit', 'change', 'delete'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit', 'add', 'change', 'delete'] + # superuser_perms = ['inherit', 'change', 'delete'] container_path = "tzcld-regions/" serializer_fields = ['@id', 'name', 'referents'] ordering = ['name'] @@ -95,10 +94,10 @@ class TzcldProfilesMembership(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Membership type') verbose_name_plural = _("TZCLD Options Membership types") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit', 'change', 'delete'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit', 'change', 'delete'] container_path = "tzcld-profile-membership/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -128,10 +127,10 @@ class TzcldProfile(Model): class Meta(Model.Meta): verbose_name = _('TZCLD User Profile') verbose_name_plural = _("TZCLD Users Profiles") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit', 'change', 'delete'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit', 'change', 'delete'] ordering = ['user'] serializer_fields = ['@id', 'last_contribution_year', 'jobs', 'regions', 'departments', 'is_member', 'is_national_referent'] rdf_type = "tzcld:profile" @@ -166,10 +165,10 @@ class TzcldProfileJob(Model): class Meta(Model.Meta): verbose_name = _('TZCLD User profile job') verbose_name_plural = _("TZCLD Users profiles jobs") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit', 'change', 'delete'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit', 'change', 'delete'] container_path = "tzcld-profile-job/" serializer_fields = ['@id', 'position', 'organisation', 'address', 'postal_code', 'city', 'department','profile', 'link','phone' ,'phone_public' ,'mobile_phone' ,'mobile_phone_public' ,'email' ,'email_public' ] nested_fields = [] @@ -193,7 +192,6 @@ class TzcldProfileEvent(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Event') verbose_name_plural = _("TZCLD Events") - anonymous_perms = ['view'] container_path = "tzcld-events/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -213,7 +211,6 @@ class TzcldProfileOrganisation(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Organisation or Territory') verbose_name_plural = _("TZCLD Organisations or Territories") - anonymous_perms = ['view'] container_path = "tzcld-orgs/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -233,7 +230,6 @@ class TzcldProfileRegion(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Region or departement') verbose_name_plural = _("TZCLD Regions or departements") - anonymous_perms = ['view'] container_path = "tzcld-regions/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -256,10 +252,10 @@ class TzcldTerritoriesStepState(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory step state') verbose_name_plural = _("TZCLD Options Territories step states") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit'] + # superuser_perms = ['inherit'] container_path = "tzcld-territories-step-states/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -277,10 +273,10 @@ class TzcldTerritoriesKind(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Kind') verbose_name_plural = _("TZCLD Options Territories Kind") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit'] + # superuser_perms = ['inherit'] container_path = "tzcld-kinds/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -298,10 +294,10 @@ class TzcldTerritoriesOriginMobilization(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Origin Mobilization') verbose_name_plural = _("TZCLD Options Origins Mobilization") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit'] + # superuser_perms = ['inherit'] container_path = "tzcld-origins-mobilization/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -320,10 +316,10 @@ class TzcldTerritoriesTrainingCourse(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Training Course') verbose_name_plural = _("TZCLD Options Training Courses") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit'] + # superuser_perms = ['inherit'] container_path = "tzcld-training-courses/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -341,10 +337,10 @@ class TzcldTerritoriesTrainingPromotion(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Training Promotion') verbose_name_plural = _("TZCLD Options Training Promotions") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit'] + # superuser_perms = ['inherit'] container_path = "tzcld-training-promotions/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -363,10 +359,10 @@ class TzcldTerritoriesTeamUserState(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Team User State') verbose_name_plural = _("TZCLD Options Team User States") - anonymous_perms = [] - authenticated_perms = ['view'] - owner_perms = ['inherit'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view'] + # owner_perms = ['inherit'] + # superuser_perms = ['inherit'] ordering = ['order'] container_path = "tzcld-team-user-states/" serializer_fields = ['@id', 'name', 'order'] @@ -394,11 +390,11 @@ class TzcldCommunity(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Profile') verbose_name_plural = _("TZCLD Territories Profiles") - permission_classes = [TzcldCommunityProfilePermissions] - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + # permission_classes = [TzcldCommunityProfilePermissions] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] ordering = ['community'] container_path = "tzcld-communities/" serializer_fields = ['@id', 'community', 'kind', 'step_state', 'kind', 'departments', 'regions', 'locations', 'primary_contact', 'membership', 'membership_organisation_name', 'visible'] @@ -428,11 +424,11 @@ class TzcldCommunityIdentity(Model): auto_author = 'author' verbose_name = _('TZCLD Territory Identity') verbose_name_plural = _("TZCLD Territories Identities") - permission_classes = [TzcldCommunityProfilePermissions] - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + # permission_classes = [TzcldCommunityProfilePermissions] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] ordering = ['community'] container_path = "tzcld-communities-identity/" serializer_fields = ['@id', 'community', 'emergence_date', 'habilitation_date', 'origin_mobilization', 'application_date', 'signatory_structure', 'birth_date', 'last_contribution_date', 'territories_project_team_memebers', 'territories_trainings', 'conversations', 'tzcld_admins_community_shared_notes', 'tzcld_admins_community_shared_files', 'date', 'author', 'territories_political_landscape_deputies', 'territories_political_landscape_senators'] @@ -461,10 +457,10 @@ class TzcldTerritoryLocation(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory location') verbose_name_plural = _("TZCLD Territories locations") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territories-location/" serializer_fields = ['@id', 'name', 'address', 'postal_code', 'city', 'phones', 'emails', 'community'] nested_fields = [] @@ -489,10 +485,10 @@ class TzcldTerritoryProjectTeamMember(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Project Team Member') verbose_name_plural = _("TZCLD Territories Project Team Members") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territories-project-team-memeber/" serializer_fields = ['@id', 'user', 'user_state', 'etp', 'attachment_structure', 'community_identity'] nested_fields = ['community_identity'] @@ -513,10 +509,10 @@ class TzcldTerritoryPoliticalLandscapeDeputy(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Political Landscape Deputy') verbose_name_plural = _("TZCLD Territories Political Landscape Deputies") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territories-political-landscape-deputy/" serializer_fields = ['@id', 'deputy', 'circonscription', 'community_identity'] nested_fields = ['community_identity'] @@ -537,10 +533,10 @@ class TzcldTerritoryPoliticalLandscapeSenator(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Political Landscape Senator') verbose_name_plural = _("TZCLD Territories Political Landscape Senators") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territories-political-landscape-senator/" serializer_fields = ['@id', 'senator', 'circonscription', 'community_identity'] nested_fields = ['community_identity'] @@ -561,10 +557,10 @@ class TzcldTerritoryTraining(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Training') verbose_name_plural = _("TZCLD Territories Trainings") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territories-training/" serializer_fields = ['@id', 'training_course', 'training_promotion', 'training_person', 'community_identity'] nested_fields = ['community_identity'] @@ -584,10 +580,10 @@ class TzcldCommunityDeliberation(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory deliberation') verbose_name_plural = _("TZCLD Options Territories deliberations") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-communities-deliberations/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -605,10 +601,10 @@ class TzcldOtherCommunityDeliberation(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Other Territory deliberation') verbose_name_plural = _("TZCLD Options Other Community deliberations") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-others-communities-deliberations/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -627,10 +623,10 @@ class TzcldCouncilDepartmentDeliberation(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Council department deliberation') verbose_name_plural = _("TZCLD Options Council department deliberations") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-councils-departments-deliberations/" serializer_fields = ['@id', 'name'] nested_fields = [] @@ -651,10 +647,10 @@ class TzcldCommunityEvaluationPointPart(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Evaluation Point Part') verbose_name_plural = _("TZCLD Territories Evaluation Point Parts") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-evaluation-point-parts/" serializer_fields = ['@id', 'name', 'title', 'subtitle', 'order', 'part_points'] ordering = ['order'] @@ -694,10 +690,10 @@ class TzcldCommunityEvaluationPoint(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Evaluation Point') verbose_name_plural = _("TZCLD Territories Evaluation Points") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] ordering = ['order'] container_path = "tzcld-communities-evaluation-points/" serializer_fields = ['@id', 'name', 'order', 'part', 'points', 'fieldType', 'evaluation_point_answer'] @@ -727,11 +723,11 @@ class TzcldCommunityEvaluationPointAnswer(Model): auto_author = 'author' verbose_name = _('TZCLD Territory Evaluation Point Answer') verbose_name_plural = _("TZCLD Territories Evaluation Point answers") - permission_classes = [TzcldCommunityProfilePermissions] - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + # permission_classes = [TzcldCommunityProfilePermissions] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-communities-evaluation-point-answers/" serializer_fields = ['@id', 'answer', 'answer_community_deliberation', 'answer_other_community_deliberation', 'answer_concil_department_deliberation', 'comment', 'evaluation_point', 'community', 'date', 'author'] rdf_type = "tzcld:communityEvaluationPointAnswer" @@ -759,10 +755,10 @@ class TzcldContactPhone(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Phone') verbose_name_plural = _("TZCLD Phones") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-contact-phone/" serializer_fields = ['@id', 'phone', 'phone_type', 'phone_public', 'job', 'location'] nested_fields = [] @@ -784,10 +780,10 @@ class TzcldContactEmail(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Email') verbose_name_plural = _("TZCLD Emails") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-contact-email/" serializer_fields = ['@id', 'email', 'email_type', 'email_public', 'job', 'location'] nested_fields = [] @@ -812,10 +808,10 @@ class TzcldTerritoryRequest(Model): auto_author = 'author' verbose_name = _('TZCLD Territory Request') verbose_name_plural = _("TZCLD Territories Requests") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territory-request/" serializer_fields = ['@id', 'user', 'date', 'contactType', 'subject', 'community', 'author'] nested_fields = ['user', 'community'] @@ -843,10 +839,10 @@ class TzcldTerritorySynthesisFollowed(Model): auto_author = 'author' verbose_name = _('TZCLD Territory Synthesis Followed') verbose_name_plural = _("TZCLD Territories Synthesis Followed") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territory-synthesis-followed/" serializer_fields = ['@id', 'context', 'strongPoints', 'questions', 'needs', 'targetdate', 'community', 'tzcld_referents_community_shared_notes', 'date', 'author', 'tzcld_referents_community_shared_files'] nested_fields = ['community'] @@ -867,10 +863,10 @@ class TzcldCommunityFollowedPointPart(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Followed Point Part') verbose_name_plural = _("TZCLD Territories Followed Point Parts") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-followed-point-parts/" serializer_fields = ['@id', 'name', 'title', 'order', 'followed_part_points'] ordering = ['order'] @@ -906,10 +902,10 @@ class TzcldCommunityFollowedPoint(Model): class Meta(Model.Meta): verbose_name = _('TZCLD Territory Followed Point') verbose_name_plural = _("TZCLD Territories Followed Points") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] ordering = ['order'] container_path = "tzcld-communities-followed-points/" serializer_fields = ['@id', 'name', 'order', 'part', 'fieldType', 'helpComment'] @@ -935,11 +931,11 @@ class TzcldCommunityFollowedPointAnswer(Model): auto_author = 'author' verbose_name = _('TZCLD Territory Followed Point Answer') verbose_name_plural = _("TZCLD Territories Followed Point answers") - permission_classes = [TzcldCommunityProfilePermissions] - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + # permission_classes = [TzcldCommunityProfilePermissions] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-communities-followed-point-answers/" serializer_fields = ['@id', 'answer', 'followed_point','community', 'date', 'author'] rdf_type = "tzcld:communityFollowedPointAnswer" @@ -965,10 +961,10 @@ class TzcldTerritorySharedNote(Model): auto_author = 'author' verbose_name = _('TZCLD Territory Shared Note') verbose_name_plural = _("TZCLD Territories Shared Notes") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territory-shared-notes/" serializer_fields = ['@id', 'author', 'longdesc', 'community_admins', 'community_referents', 'conversations', 'date'] nested_fields = ['author', 'community_admins', 'community_referents', 'conversations'] @@ -994,10 +990,10 @@ class TzcldTerritorySharedFile(Model): auto_author = 'author' verbose_name = _('TZCLD Territory Shared File') verbose_name_plural = _("TZCLD Territories Shared Files") - anonymous_perms = [] - authenticated_perms = ['view', 'add'] - owner_perms = ['inherit', 'change', 'delete'] - superuser_perms = ['inherit'] + + # authenticated_perms = ['view', 'add'] + # owner_perms = ['inherit', 'change', 'delete'] + # superuser_perms = ['inherit'] container_path = "tzcld-territory-shared-files/" serializer_fields = ['@id', 'author', 'name', 'date', 'document', 'community_admins', 'community_referents'] nested_fields = ['author', 'community_admins', 'community_referents'] diff --git a/djangoldp_tzcld/permissions.py b/djangoldp_tzcld/permissions.py deleted file mode 100644 index 4587dde0c2f14a9b31b63443c33d47d0f0f05928..0000000000000000000000000000000000000000 --- a/djangoldp_tzcld/permissions.py +++ /dev/null @@ -1,22 +0,0 @@ -from djangoldp_community.permissions import CommunityPermissions -from django.urls import resolve -from djangoldp.utils import is_authenticated_user - - -class TzcldCommunityProfilePermissions(CommunityPermissions): - filter_backends = [] - - def get_container_permissions(self, request, view, obj=None): - perms = set({'view'}) - if obj is None: - from djangoldp_community.models import Community - resolved = resolve(request.path_info) - if 'slug' in resolved.kwargs and (resolved.url_name == "tzcldcommunity-list" or - resolved.url_name == "tzcldcommunity-detail"): - community = Community.objects.get(slug=resolved.kwargs['slug']) - if is_authenticated_user(request.user) and community.members.filter(user=request.user).exists(): - if community.members.get(user=request.user).is_admin: - perms = perms.union({'add', 'change'}) - else: - return self.get_object_permissions(request, view, obj) - return perms diff --git a/djangoldp_tzcld/views.py b/djangoldp_tzcld/views.py index f6de4df2681d72527c95e8b2623cc91c1e2b9eee..4fa78d73db7277767bb3717d5af96a5a00751ee3 100644 --- a/djangoldp_tzcld/views.py +++ b/djangoldp_tzcld/views.py @@ -7,7 +7,7 @@ class MyTerritoriesView(LDPViewSet): parent_model = Community def get_queryset(self): user = self.request.user - return super().get_queryset().filter(Q(tzcld_profile__regions__referents=user) | Q(members__in=user.communities.filter(is_admin=True))).distinct() + return super().get_queryset().filter(Q(tzcld_profile__regions__referents=user) | Q(admins__user=user)).distinct() class MemberOfCommunitiesView(LDPViewSet): model = Community