@@ -103,7 +103,7 @@ def give_permission_to(self, *args):
103103 """Give permission to related model"""
104104 from ..models .permission import Permission
105105
106- if type (args [0 ]) == list :
106+ if type (args [0 ]) is list :
107107 args = args [0 ]
108108
109109 permissions = Permission .where_in ("slug" , args ).get ()
@@ -132,7 +132,7 @@ def revoke_permission_to(self, *args):
132132 """Revoke permission from related model"""
133133 from ..models .permission import Permission
134134
135- if type (args [0 ]) == list :
135+ if type (args [0 ]) is list :
136136 args = args [0 ]
137137
138138 permissions = Permission .where_in ("slug" , args ).get ()
@@ -158,7 +158,7 @@ def _get_permission_ids(self, args):
158158 ).where ("permissionable_type" , self .get_table_name ()).delete ()
159159 return
160160
161- if type (args [0 ]) == list :
161+ if type (args [0 ]) is list :
162162 args = args [0 ]
163163
164164 for permission in args :
@@ -208,15 +208,15 @@ def sync_permissions(self, *args):
208208 query .bulk_create (data )
209209
210210 def has_permission_to (self , permission ):
211- if type (permission ) != str :
211+ if type (permission ) is not str :
212212 raise PermissionException ("permission must be a string!" )
213213 return self ._permission_query ().where ("permissions.slug" , permission ).count () > 0
214214
215215 def has_any_permission (self , * args ):
216216 """Check if user has any of the permissions"""
217217
218218 slugs = []
219- if type (args [0 ]) == list :
219+ if type (args [0 ]) is list :
220220 slugs = args [0 ]
221221 else :
222222 slugs = list (args )
@@ -227,7 +227,7 @@ def has_all_permissions(self, *args):
227227 """Check if user has all of the permissions"""
228228
229229 slugs = []
230- if type (args [0 ]) == list :
230+ if type (args [0 ]) is list :
231231 slugs = args [0 ]
232232 else :
233233 slugs = list (args )
@@ -236,7 +236,7 @@ def has_all_permissions(self, *args):
236236
237237 def can_ (self , permissions ):
238238 """Check if user has a permission"""
239- if type (permissions ) != str :
239+ if type (permissions ) is not str :
240240 raise PermissionException ("permission must be a string!" )
241241
242242 action = "all" # can be all or any
0 commit comments