44from django .utils .deprecation import MiddlewareMixin
55
66
7- from access .models .tenant import Tenant as Organization
7+ from access .models .tenant import Tenant
88from access .models .team import Team
99
1010
@@ -40,8 +40,8 @@ class Tenancy:
4040 _app_settings : AppSettings = None
4141
4242
43- _user_organizations : list ([Organization ]) = None
44- """Cached User Organizations """
43+ _user_organizations : list ([Tenant ]) = None
44+ """Cached User Tenants """
4545
4646 _user_teams : list ([Team ]) = None
4747 """Cached User Teams"""
@@ -90,7 +90,7 @@ def __init__(self, user: User, app_settings: AppSettings):
9090
9191
9292
93- def is_member (self , organization : Organization ) -> bool :
93+ def is_member (self , organization : Tenant ) -> bool :
9494 """Returns true if the current user is a member of the organization
9595
9696 iterates over the user_organizations list and returns true if the user is a member
@@ -113,11 +113,11 @@ def is_member(self, organization: Organization) -> bool:
113113
114114
115115
116- def has_organization_permission (self , organization : Organization , permissions_required : str ) -> bool :
116+ def has_organization_permission (self , organization : Tenant , permissions_required : str ) -> bool :
117117 """ Check if user has permission within organization.
118118
119119 Args:
120- organization (int): Organization to check.
120+ organization (int): Tenant to check.
121121 permissions_required (list): if doing object level permissions, pass in required permission.
122122
123123 Returns:
@@ -126,9 +126,9 @@ def has_organization_permission(self, organization: Organization, permissions_re
126126
127127 has_permission : bool = False
128128
129- if type (organization ) is not Organization :
129+ if type (organization ) is not Tenant :
130130
131- raise TypeError ('Organization must be of type Organization ' )
131+ raise TypeError ('Tenant must be of type Tenant ' )
132132
133133
134134 if type (permissions_required ) is not str :
0 commit comments