#NEWLINE# def has_permission( self , package , perm ) : #NEWLINE# #INDENT# ' Check if this user has a permission for a package ' #NEWLINE# current_userid = self . request . userid #NEWLINE# if ( ( current_userid is not None ) and self . is_admin ( current_userid ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# perms = self . allowed_permissions ( package ) #NEWLINE# for principal in effective_principals ( self . request ) : #NEWLINE# #INDENT# if ( perm in perms . get ( package , [ ] ) ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# return False