diff --git a/test/test_live.py b/test/test_live.py index ddb1b92..57c57ec 100644 --- a/test/test_live.py +++ b/test/test_live.py @@ -293,7 +293,7 @@ def test_multitenancy_example(self): self.assertEqual(len(tenant1_users_list.results), 0) # Assign user1 -> tenant1 - tenant1.assign_user(user1.id, "member") + tenant1.assign_user(user1.id) user1_tenants_list = warrant.Tenant.list_for_user(user1.id, {"limit": 100}, {"Warrant-Token": "latest"}) self.assertEqual(len(user1_tenants_list.results), 1) @@ -306,7 +306,7 @@ def test_multitenancy_example(self): self.assertEqual(tenant1_users_list.results[0].meta, {}) # Remove user1 -> tenant1 - tenant1.remove_user(user1.id, "member") + tenant1.remove_user(user1.id) user1_tenants_list = warrant.Tenant.list_for_user(user1.id, {"limit": 100}, {"Warrant-Token": "latest"}) self.assertEqual(len(user1_tenants_list.results), 0) @@ -346,8 +346,8 @@ def test_rbac_example(self): self.assertEqual(admin_user_has_permission, False) # Assign 'create-report' -> admin role -> admin user - admin_role.assign_permission(create_permission.id, "member") - admin_user.assign_role(admin_role.id, "member") + admin_role.assign_permission(create_permission.id) + admin_user.assign_role(admin_role.id) admin_user_has_permission = admin_user.has_permission(create_permission.id, {"Warrant-Token": "latest"}) self.assertEqual(admin_user_has_permission, True) @@ -363,8 +363,8 @@ def test_rbac_example(self): self.assertEqual(admin_role_permissions_list.results[0].meta, {"name": "Create Report", "description": "Permission to create reports"}) # Remove 'create-report' -> admin role -> admin user - admin_role.remove_permission(create_permission.id, "member") - admin_user.remove_role(admin_role.id, "member") + admin_role.remove_permission(create_permission.id) + admin_user.remove_role(admin_role.id) admin_user_has_permission = admin_user.has_permission(create_permission.id, {"Warrant-Token": "latest"}) self.assertEqual(admin_user_has_permission, False) @@ -382,7 +382,7 @@ def test_rbac_example(self): viewer_user_permissions_list = warrant.Permission.list_for_user(viewer_user.id, {"limit": 100}, {"Warrant-Token": "latest"}) self.assertEqual(len(viewer_user_permissions_list.results), 0) - viewer_user.assign_permission(view_permission.id, "member") + viewer_user.assign_permission(view_permission.id) viewer_user_has_permission = viewer_user.has_permission(view_permission.id, {"Warrant-Token": "latest"}) self.assertEqual(viewer_user_has_permission, True) @@ -392,7 +392,7 @@ def test_rbac_example(self): self.assertEqual(viewer_user_permissions_list.results[0].object_id, view_permission.id) self.assertEqual(viewer_user_permissions_list.results[0].meta, {"name": "View Report", "description": "Permission to view reports"}) - viewer_user.remove_permission(view_permission.id, "member") + viewer_user.remove_permission(view_permission.id) viewer_user_has_permission = viewer_user.has_permission(view_permission.id, {"Warrant-Token": "latest"}) self.assertEqual(viewer_user_has_permission, False) @@ -435,7 +435,7 @@ def test_pricing_tiers_features_and_users_example(self): paid_user_features_list = warrant.Feature.list_for_user(paid_user.id, {"limit": 100}, {"Warrant-Token": "latest"}) self.assertEqual(len(paid_user_features_list.results), 0) - paid_user.assign_feature(custom_feature.id, "member") + paid_user.assign_feature(custom_feature.id) paid_user_has_feature = paid_user.has_feature(custom_feature.id, {"Warrant-Token": "latest"}) self.assertEqual(paid_user_has_feature, True) @@ -445,7 +445,7 @@ def test_pricing_tiers_features_and_users_example(self): self.assertEqual(paid_user_features_list.results[0].object_id, "custom-feature") self.assertEqual(paid_user_features_list.results[0].meta, {"name": "Custom Feature"}) - paid_user.remove_feature(custom_feature.id, "member") + paid_user.remove_feature(custom_feature.id) paid_user_has_feature = paid_user.has_feature(custom_feature.id, {"Warrant-Token": "latest"}) self.assertEqual(paid_user_has_feature, False) @@ -463,8 +463,8 @@ def test_pricing_tiers_features_and_users_example(self): free_user_tiers_list = warrant.PricingTier.list_for_user(free_user.id, {"limit": 100}, {"Warrant-Token": "latest"}) self.assertEqual(len(free_user_tiers_list.results), 0) - free_tier.assign_feature(feature1.id, "member") - free_user.assign_pricing_tier(free_tier.id, "member") + free_tier.assign_feature(feature1.id) + free_user.assign_pricing_tier(free_tier.id) free_user_has_feature = free_user.has_feature(feature1.id, {"Warrant-Token": "latest"}) self.assertEqual(free_user_has_feature, True) @@ -479,8 +479,8 @@ def test_pricing_tiers_features_and_users_example(self): self.assertEqual(free_user_tiers_list.results[0].object_id, "free") self.assertEqual(free_user_tiers_list.results[0].meta, {"name": "Free Tier"}) - free_tier.remove_feature(feature1.id, "member") - free_user.remove_pricing_tier(free_tier.id, "member") + free_tier.remove_feature(feature1.id) + free_user.remove_pricing_tier(free_tier.id) free_user_has_feature = free_user.has_feature(feature1.id, {"Warrant-Token": "latest"}) self.assertEqual(free_user_has_feature, False) @@ -528,7 +528,7 @@ def test_pricing_tiers_features_and_tenants_example(self): paid_tenant_features_list = paid_tenant.list_features({"limit": 100}, {"Warrant-Token": "latest"}) self.assertEqual(len(paid_tenant_features_list.results), 0) - paid_tenant.assign_feature(custom_feature.id, "member") + paid_tenant.assign_feature(custom_feature.id) paid_tenant_has_feature = paid_tenant.has_feature(custom_feature.id, {"Warrant-Token": "latest"}) self.assertEqual(paid_tenant_has_feature, True) @@ -538,7 +538,7 @@ def test_pricing_tiers_features_and_tenants_example(self): self.assertEqual(paid_tenant_features_list.results[0].object_id, "custom-feature") self.assertEqual(paid_tenant_features_list.results[0].meta, {"name": "Custom Feature"}) - paid_tenant.remove_feature(custom_feature.id, "member") + paid_tenant.remove_feature(custom_feature.id) paid_tenant_has_feature = paid_tenant.has_feature(custom_feature.id, {"Warrant-Token": "latest"}) self.assertEqual(paid_tenant_has_feature, False) @@ -556,8 +556,8 @@ def test_pricing_tiers_features_and_tenants_example(self): free_tenant_tiers_list = free_tenant.list_pricing_tiers({"limit": 100}, {"Warrant-Token": "latest"}) self.assertEqual(len(free_tenant_tiers_list.results), 0) - free_tier.assign_feature(feature1.id, "member") - free_tenant.assign_pricing_tier(free_tier.id, "member") + free_tier.assign_feature(feature1.id) + free_tenant.assign_pricing_tier(free_tier.id) free_tenant_has_feature = free_tenant.has_feature(feature1.id, {"Warrant-Token": "latest"}) self.assertEqual(free_tenant_has_feature, True) @@ -572,8 +572,8 @@ def test_pricing_tiers_features_and_tenants_example(self): self.assertEqual(free_tenant_tiers_list.results[0].object_id, "free") self.assertEqual(free_tenant_tiers_list.results[0].meta, {"name": "Free Tier"}) - free_tier.remove_feature(feature1.id, "member") - free_tenant.remove_pricing_tier(free_tier.id, "member") + free_tier.remove_feature(feature1.id) + free_tenant.remove_pricing_tier(free_tier.id) free_tenant_has_feature = free_tenant.has_feature(feature1.id, {"Warrant-Token": "latest"}) self.assertEqual(free_tenant_has_feature, False) diff --git a/warrant/feature.py b/warrant/feature.py index 70bcbca..58da421 100644 --- a/warrant/feature.py +++ b/warrant/feature.py @@ -52,12 +52,12 @@ def list_for_pricing_tier(cls, pricing_tier_id: str, list_params: Dict[str, Any] return ListResult[Feature](list(features)) @classmethod - def assign_to_pricing_tier(cls, pricing_tier_id: str, feature_id: str, relation, opts: Dict[str, Any] = {}): + def assign_to_pricing_tier(cls, pricing_tier_id: str, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): pricing_tier_subject = Subject(constants.PRICING_TIER_OBJECT_TYPE, pricing_tier_id) return Warrant.create(constants.FEATURE_OBJECT_TYPE, feature_id, relation, pricing_tier_subject, opts=opts) @classmethod - def remove_from_pricing_tier(cls, pricing_tier_id: str, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_pricing_tier(cls, pricing_tier_id: str, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): pricing_tier_subject = Subject(constants.PRICING_TIER_OBJECT_TYPE, pricing_tier_id) return Warrant.delete(constants.FEATURE_OBJECT_TYPE, feature_id, relation, pricing_tier_subject, opts=opts) @@ -78,12 +78,12 @@ def list_for_tenant(cls, tenant_id: str, list_params: Dict[str, Any] = {}, opts: return ListResult[Feature](list(features)) @classmethod - def assign_to_tenant(cls, tenant_id: str, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_to_tenant(cls, tenant_id: str, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): tenant_subject = Subject(constants.TENANT_OBJECT_TYPE, tenant_id) return Warrant.create(constants.FEATURE_OBJECT_TYPE, feature_id, relation, tenant_subject, opts=opts) @classmethod - def remove_from_tenant(cls, tenant_id: str, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_tenant(cls, tenant_id: str, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): tenant_subject = Subject(constants.TENANT_OBJECT_TYPE, tenant_id) return Warrant.delete(constants.FEATURE_OBJECT_TYPE, feature_id, relation, tenant_subject, opts=opts) @@ -104,12 +104,12 @@ def list_for_user(cls, user_id: str, list_params: Dict[str, Any] = {}, opts: Dic return ListResult[Feature](list(features)) @classmethod - def assign_to_user(cls, user_id: str, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_to_user(cls, user_id: str, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.create(constants.FEATURE_OBJECT_TYPE, feature_id, relation, user_subject, opts=opts) @classmethod - def remove_from_user(cls, user_id: str, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_user(cls, user_id: str, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.delete(constants.FEATURE_OBJECT_TYPE, feature_id, relation, user_subject, opts=opts) diff --git a/warrant/permission.py b/warrant/permission.py index 4fb94a0..2d6898e 100644 --- a/warrant/permission.py +++ b/warrant/permission.py @@ -52,12 +52,12 @@ def list_for_user(cls, user_id: str, list_params: Dict[str, Any] = {}, opts: Dic return ListResult[Permission](list(permissions)) @classmethod - def assign_to_user(cls, user_id: str, permission_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_to_user(cls, user_id: str, permission_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.create(constants.PERMISSION_OBJECT_TYPE, permission_id, relation, user_subject, opts=opts) @classmethod - def remove_from_user(cls, user_id: str, permission_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_user(cls, user_id: str, permission_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.delete(constants.PERMISSION_OBJECT_TYPE, permission_id, relation, user_subject, opts=opts) @@ -78,12 +78,12 @@ def list_for_role(cls, role_id: str, list_params: Dict[str, Any] = {}, opts: Dic return ListResult[Permission](list(permissions)) @classmethod - def assign_to_role(cls, role_id: str, permission_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_to_role(cls, role_id: str, permission_id: str, relation: str = "member", opts: Dict[str, Any] = {}): role_subject = Subject(constants.ROLE_OBJECT_TYPE, role_id) return Warrant.create(constants.PERMISSION_OBJECT_TYPE, permission_id, relation, role_subject, opts=opts) @classmethod - def remove_from_role(cls, role_id: str, permission_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_role(cls, role_id: str, permission_id: str, relation: str = "member", opts: Dict[str, Any] = {}): role_subject = Subject(constants.ROLE_OBJECT_TYPE, role_id) return Warrant.delete(constants.PERMISSION_OBJECT_TYPE, permission_id, relation, role_subject, opts=opts) diff --git a/warrant/pricing_tier.py b/warrant/pricing_tier.py index 7c3c745..2adff74 100644 --- a/warrant/pricing_tier.py +++ b/warrant/pricing_tier.py @@ -41,10 +41,10 @@ def delete(cls, id: str, opts: Dict[str, Any] = {}): def list_features(self, list_params: Dict[str, Any] = {}, opts: Dict[str, Any] = {}) -> ListResult[Feature]: return Feature.list_for_pricing_tier(pricing_tier_id=self.id, list_params=list_params, opts=opts) - def assign_feature(self, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_feature(self, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Feature.assign_to_pricing_tier(pricing_tier_id=self.id, feature_id=feature_id, relation=relation, opts=opts) - def remove_feature(self, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_feature(self, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Feature.remove_from_pricing_tier(pricing_tier_id=self.id, feature_id=feature_id, relation=relation, opts=opts) """ @@ -64,12 +64,12 @@ def list_for_tenant(cls, tenant_id: str, list_params: Dict[str, Any] = {}, opts: return ListResult[PricingTier](list(pricing_tiers)) @classmethod - def assign_to_tenant(cls, tenant_id: str, pricing_tier_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_to_tenant(cls, tenant_id: str, pricing_tier_id: str, relation: str = "member", opts: Dict[str, Any] = {}): tenant_subject = Subject(constants.TENANT_OBJECT_TYPE, tenant_id) return Warrant.create(constants.PRICING_TIER_OBJECT_TYPE, pricing_tier_id, relation, tenant_subject, opts=opts) @classmethod - def remove_from_tenant(cls, tenant_id: str, pricing_tier_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_tenant(cls, tenant_id: str, pricing_tier_id: str, relation: str = "member", opts: Dict[str, Any] = {}): tenant_subject = Subject(constants.TENANT_OBJECT_TYPE, tenant_id) return Warrant.delete(constants.PRICING_TIER_OBJECT_TYPE, pricing_tier_id, relation, tenant_subject, opts=opts) @@ -90,12 +90,12 @@ def list_for_user(cls, user_id: str, list_params: Dict[str, Any] = {}, opts: Dic return ListResult[PricingTier](list(pricing_tiers)) @classmethod - def assign_to_user(cls, user_id: str, pricing_tier_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_to_user(cls, user_id: str, pricing_tier_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.create(constants.PRICING_TIER_OBJECT_TYPE, pricing_tier_id, relation, user_subject, opts=opts) @classmethod - def remove_from_user(cls, user_id: str, pricing_tier_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_user(cls, user_id: str, pricing_tier_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.delete(constants.PRICING_TIER_OBJECT_TYPE, pricing_tier_id, relation, user_subject, opts=opts) diff --git a/warrant/role.py b/warrant/role.py index 1ca8c85..52468a6 100644 --- a/warrant/role.py +++ b/warrant/role.py @@ -52,12 +52,12 @@ def list_for_user(cls, user_id: str, list_params: Dict[str, Any] = {}, opts: Dic return ListResult[Role](list(roles)) @classmethod - def assign_to_user(cls, user_id: str, role_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_to_user(cls, user_id: str, role_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.create(constants.ROLE_OBJECT_TYPE, role_id, relation, user_subject, opts=opts) @classmethod - def remove_from_user(cls, user_id: str, role_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_user(cls, user_id: str, role_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.delete(constants.ROLE_OBJECT_TYPE, role_id, relation, user_subject, opts=opts) @@ -67,10 +67,10 @@ def remove_from_user(cls, user_id: str, role_id: str, relation: str, opts: Dict[ def list_permissions(self, list_params: Dict[str, Any] = {}, opts: Dict[str, Any] = {}) -> ListResult["Permission"]: return Permission.list_for_role(self.id, list_params, opts=opts) - def assign_permission(self, permission_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_permission(self, permission_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Permission.assign_to_role(self.id, permission_id, relation, opts=opts) - def remove_permission(self, permission_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_permission(self, permission_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Permission.remove_from_role(self.id, permission_id, relation, opts=opts) """ diff --git a/warrant/tenant.py b/warrant/tenant.py index 97636ec..0dd4d0f 100644 --- a/warrant/tenant.py +++ b/warrant/tenant.py @@ -69,10 +69,10 @@ def list_for_user(cls, user_id: str, list_params: Dict[str, Any] = {}, opts: Dic def list_users(self, list_params: Dict[str, Any] = {}, opts: Dict[str, Any] = {}) -> ListResult["User"]: return User.list_for_tenant(self.id, list_params, opts=opts) - def assign_user(self, user_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_user(self, user_id: str, relation: str = "member", opts: Dict[str, Any] = {}): User.assign_to_tenant(self.id, user_id, relation, opts=opts) - def remove_user(self, user_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_user(self, user_id: str, relation: str = "member", opts: Dict[str, Any] = {}): User.remove_from_tenant(self.id, user_id, relation, opts=opts) """ @@ -81,10 +81,10 @@ def remove_user(self, user_id: str, relation: str, opts: Dict[str, Any] = {}): def list_pricing_tiers(self, list_params: Dict[str, Any] = {}, opts: Dict[str, Any] = {}): return PricingTier.list_for_tenant(self.id, list_params, opts=opts) - def assign_pricing_tier(self, pricing_tier_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_pricing_tier(self, pricing_tier_id: str, relation: str = "member", opts: Dict[str, Any] = {}): PricingTier.assign_to_tenant(self.id, pricing_tier_id, relation, opts=opts) - def remove_pricing_tier(self, pricing_tier_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_pricing_tier(self, pricing_tier_id: str, relation: str = "member", opts: Dict[str, Any] = {}): PricingTier.remove_from_tenant(self.id, pricing_tier_id, relation, opts=opts) """ @@ -93,10 +93,10 @@ def remove_pricing_tier(self, pricing_tier_id: str, relation: str, opts: Dict[st def list_features(self, list_params: Dict[str, Any] = {}, opts: Dict[str, Any] = {}): return Feature.list_for_tenant(self.id, list_params, opts=opts) - def assign_feature(self, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_feature(self, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Feature.assign_to_tenant(self.id, feature_id, relation, opts=opts) - def remove_feature(self, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_feature(self, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Feature.remove_from_tenant(self.id, feature_id, relation, opts=opts) def has_feature(self, feature_id: str, opts: Dict[str, Any] = {}): diff --git a/warrant/user.py b/warrant/user.py index d341c48..f21a543 100644 --- a/warrant/user.py +++ b/warrant/user.py @@ -64,12 +64,12 @@ def batch_delete(cls, users: List[Dict[str, Any]], opts: Dict[str, Any] = {}) -> Tenants """ @classmethod - def assign_to_tenant(cls, tenant_id: str, user_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_to_tenant(cls, tenant_id: str, user_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.create(constants.TENANT_OBJECT_TYPE, tenant_id, relation, user_subject, opts=opts) @classmethod - def remove_from_tenant(cls, tenant_id: str, user_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_from_tenant(cls, tenant_id: str, user_id: str, relation: str = "member", opts: Dict[str, Any] = {}): user_subject = Subject(constants.USER_OBJECT_TYPE, user_id) return Warrant.delete(constants.TENANT_OBJECT_TYPE, tenant_id, relation, user_subject, opts=opts) @@ -79,10 +79,10 @@ def remove_from_tenant(cls, tenant_id: str, user_id: str, relation: str, opts: D def list_roles(self, list_params: Dict[str, Any] = {}, opts: Dict[str, Any] = {}): return Role.list_for_user(self.id, list_params, opts=opts) - def assign_role(self, role_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_role(self, role_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Role.assign_to_user(self.id, role_id, relation, opts=opts) - def remove_role(self, role_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_role(self, role_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Role.remove_from_user(self.id, role_id, relation, opts=opts) """ @@ -91,10 +91,10 @@ def remove_role(self, role_id: str, relation: str, opts: Dict[str, Any] = {}): def list_permissions(self, list_params: Dict[str, Any] = {}, opts: Dict[str, Any] = {}): return Permission.list_for_user(self.id, list_params, opts=opts) - def assign_permission(self, permission_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_permission(self, permission_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Permission.assign_to_user(self.id, permission_id, relation, opts=opts) - def remove_permission(self, permission_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_permission(self, permission_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Permission.remove_from_user(self.id, permission_id, relation, opts=opts) def has_permission(self, permission_id: str, opts: Dict[str, Any] = {}): @@ -106,10 +106,10 @@ def has_permission(self, permission_id: str, opts: Dict[str, Any] = {}): def list_pricing_tiers(self, list_params: Dict[str, Any] = {}, opts: Dict[str, Any] = {}): return PricingTier.list_for_user(self.id, list_params, opts=opts) - def assign_pricing_tier(self, pricing_tier_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_pricing_tier(self, pricing_tier_id: str, relation: str = "member", opts: Dict[str, Any] = {}): PricingTier.assign_to_user(self.id, pricing_tier_id, relation, opts=opts) - def remove_pricing_tier(self, pricing_tier_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_pricing_tier(self, pricing_tier_id: str, relation: str = "member", opts: Dict[str, Any] = {}): PricingTier.remove_from_user(self.id, pricing_tier_id, relation, opts=opts) """ @@ -118,10 +118,10 @@ def remove_pricing_tier(self, pricing_tier_id: str, relation: str, opts: Dict[st def list_features(self, list_params={}, opts: Dict[str, Any] = {}): return Feature.list_for_user(self.id, list_params, opts=opts) - def assign_feature(self, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def assign_feature(self, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Feature.assign_to_user(self.id, feature_id, relation, opts=opts) - def remove_feature(self, feature_id: str, relation: str, opts: Dict[str, Any] = {}): + def remove_feature(self, feature_id: str, relation: str = "member", opts: Dict[str, Any] = {}): Feature.remove_from_user(self.id, feature_id, relation, opts=opts) def has_feature(self, feature_id: str, opts: Dict[str, Any] = {}):