original_docstring: Check whether a principal has a certain management permission.
  
          The check always succeeds if the user is a full manager; in
          that case the list of permissions is ignored.
  
          :param permission: The permission to check for or 'ANY' to check for any
                       management permission.
          :param explicit: Whether to check for the permission itself even if
                           the user has full management privileges.
          
docstring: Check whether a principal has a certain management permission.
  The check always succeeds if the user is a full manager; in
  that case the list of permissions is ignored.
docstring_tokens: Check whether a principal has a certain management permission . The check always succeeds if the user is a full manager ; in that case the list of permissions is ignored .
code: def has_management_permission(self, permission=None, explicit=False):
          """Check whether a principal has a certain management permission.
  
          The check always succeeds if the user is a full manager; in
          that case the list of permissions is ignored.
  
          :param permission: The permission to check for or 'ANY' to check for any
                       management permission.
          :param explicit: Whether to check for the permission itself even if
                           the user has full management privileges.
          """
          if permission is None:
              if explicit:
                  raise ValueError('permission must be specified if explicit=True')
              return self.full_access
          elif not explicit and self.full_access:
              return True
          valid_permissions = get_available_permissions(self.principal_for_obj).viewkeys()
          current_permissions = set(self.permissions) & valid_permissions
          if permission == 'ANY':
              return bool(current_permissions)
          assert permission in valid_permissions, "invalid permission '{}' for object '{}'".format(permission,
                                                                                                   self.principal_for_obj)
          return permission in current_permissions
code_tokens: def has_management_permission ( self , permission = None , explicit = False ) : if permission is None : if explicit : raise ValueError ( 'permission must be specified if explicit=True' ) return self . full_access elif not explicit and self . full_access : return True valid_permissions = get_available_permissions ( self . principal_for_obj ) . viewkeys ( ) current_permissions = set ( self . permissions ) & valid_permissions if permission == 'ANY' : return bool ( current_permissions ) assert permission in valid_permissions , "invalid permission '{}' for object '{}'" . format ( permission , self . principal_for_obj ) return permission in current_permissions
short_docstring: Check whether a principal has a certain management permission.
short_docstring_tokens: Check whether a principal has a certain management permission .
comment: """Check whether a principal has a certain management permission.
  
          The check always succeeds if the user is a full manager; in
          that case the list of permissions is ignored.
  
          :param permission: The permission to check for or 'ANY' to check for any
                       management permission.
          :param explicit: Whether to check for the permission itself even if
                           the user has full management privileges.
          """