#NEWLINE# def can_update( self , user ) : #NEWLINE# #INDENT# if user . is_readonly : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if user . is_admin : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# cprivs = ControllerSlicePrivilege . objects . filter ( slice_privilege__user = user ) #NEWLINE# for cpriv in dprivs : #NEWLINE# #INDENT# if ( cpriv . role . role == [ 'admin' , 'Admin' ] ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# return False