Exemplo n.º 1
0
 def get_user_effective_permissions(self, user_name):
     """Gets the effective permissions that the specified user has within the current application scope.
     :type user_name: str
     """
     result = ClientResult(self.context, BasePermissions())
     qry = ServiceOperationQuery(self, "GetUserEffectivePermissions", [user_name], None, None, result)
     self.context.add_query(qry)
     return result
Exemplo n.º 2
0
    def get_user_effective_permissions(self, user_name):
        """
        Returns the user permissions for this list.

        :param str user_name: Specifies the user login name.
        """
        result = ClientResult(BasePermissions())
        qry = ServiceOperationQuery(self, "getUserEffectivePermissions",
                                    [user_name], None, None, result)
        self.context.add_query(qry)
        return result
Exemplo n.º 3
0
    def __init__(self, name=None, description=None, order=None):
        """Contains properties that are used as parameters to initialize a role definition.

        :param str name: Specifies the name of the role definition.
        :param str description: Specifies the description of the role definition.
        :param int order: Specifies the order in which roles MUST be displayed in the WFE.
        """
        super(RoleDefinitionCreationInformation, self).__init__()
        self.Name = name
        self.Description = description
        self.BasePermissions = BasePermissions()
        self.Order = order
Exemplo n.º 4
0
    def get_user_effective_permissions(self, user_or_name):
        """
        Returns the user permissions for this list.

        :param str or User user_or_name: Specifies the user login name or User object.
        """
        result = ClientResult(self.context, BasePermissions())

        if isinstance(user_or_name, User):

            def _user_loaded():
                next_qry = ServiceOperationQuery(
                    self, "GetUserEffectivePermissions",
                    [user_or_name.login_name], None, None, result)
                self.context.add_query(next_qry)

            user_or_name.ensure_property("LoginName", _user_loaded)
        else:
            qry = ServiceOperationQuery(self, "GetUserEffectivePermissions",
                                        [user_or_name], None, None, result)
            self.context.add_query(qry)
        return result
Exemplo n.º 5
0
 def effective_base_permissions(self):
     """Gets a value that specifies the effective permissions on the list item that are assigned
        to the current user."""
     from office365.sharepoint.permissions.base_permissions import BasePermissions
     return self.properties.get("EffectiveBasePermissions",
                                BasePermissions())
Exemplo n.º 6
0
 def test4_does_user_has_perms(self):
     perms = BasePermissions()
     perms.set(PermissionKind.ManageWeb)
     result = self.client.web.does_user_have_permissions(
         perms).execute_query()
     self.assertIsInstance(result.value, bool)
 def __init__(self):
     """Contains properties that are used as parameters to initialize a role definition."""
     super(RoleDefinitionCreationInformation, self).__init__()
     self.Name = None
     self.Description = None
     self.BasePermissions = BasePermissions()
Exemplo n.º 8
0
 def rights(self):
     """Specifies the permissions needed for the custom action."""
     return self.properties.get("Rights", BasePermissions())