程序包 cn.leancloud

类 LCACL


  • public class LCACL
    extends java.lang.Object
    • 嵌套类概要

      嵌套类 
      修饰符和类型 说明
      static class  LCACL.Permissions  
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      boolean equals​(java.lang.Object o)  
      java.util.Map<java.lang.String,​LCACL.Permissions> getPermissionsById()
      get permissions by id.
      boolean getPublicReadAccess()
      Get whether the public is allowed to read this object.
      boolean getPublicWriteAccess()
      Set whether the public is allowed to write this object.
      boolean getReadAccess​(LCUser user)
      Get whether the given user is *explicitly* allowed to read this object.
      boolean getReadAccess​(java.lang.String userId)
      Get whether the given user id is *explicitly* allowed to read this object.
      boolean getRoleReadAccess​(java.lang.String role)
      Get whether the given role is *explicitly* allowed to read this object.
      boolean getRoleWriteAccess​(java.lang.String role)
      Get whether the given role is *explicitly* allowed to write this object.
      boolean getWriteAccess​(LCUser user)
      Get whether the given user is *explicitly* allowed to write this object.
      boolean getWriteAccess​(java.lang.String userId)
      Get whether the given user id is *explicitly* allowed to write this object.
      int hashCode()  
      void setPublicReadAccess​(boolean allowed)
      Set whether the public is allowed to read this object.
      void setPublicWriteAccess​(boolean allowed)
      Set whether the public is allowed to write this object.
      void setReadAccess​(LCUser user, boolean allowed)
      Set whether the given user is allowed to read this object.
      void setReadAccess​(java.lang.String userId, boolean allowed)
      Set whether the given user id is allowed to read this object.
      void setRoleReadAccess​(java.lang.String role, boolean allowed)
      Set whether the given role is allowed to read this object.
      void setRoleWriteAccess​(java.lang.String role, boolean allowed)
      Set whether the given role is allowed to write this object.
      void setWriteAccess​(LCUser user, boolean allowed)
      Set whether the given user is allowed to write this object.
      void setWriteAccess​(java.lang.String userId, boolean allowed)
      Set whether the given user id is allowed to write this object.
      JSONObject toJSONObject()
      get json object.
      • 从类继承的方法 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • LCACL

        public LCACL()
      • LCACL

        public LCACL​(java.util.HashMap data)
        constructor
        参数:
        data - hash map for acl.
      • LCACL

        public LCACL​(LCACL other)
        copy constructor
        参数:
        other - other instance
      • LCACL

        public LCACL​(LCUser owner)
        constructor
        参数:
        owner - owner with read/write permission.
    • 方法详细资料

      • getPermissionsById

        public java.util.Map<java.lang.String,​LCACL.Permissions> getPermissionsById()
        get permissions by id.
        返回:
        hash map for id and permission.
      • equals

        public boolean equals​(java.lang.Object o)
        覆盖:
        equals 在类中 java.lang.Object
      • hashCode

        public int hashCode()
        覆盖:
        hashCode 在类中 java.lang.Object
      • toJSONObject

        public JSONObject toJSONObject()
        get json object.
        返回:
        json object.
      • setPublicReadAccess

        public void setPublicReadAccess​(boolean allowed)
        Set whether the public is allowed to read this object.
        参数:
        allowed - flag to allow.
      • getPublicReadAccess

        public boolean getPublicReadAccess()
        Get whether the public is allowed to read this object.
        返回:
        public read permission.
      • setPublicWriteAccess

        public void setPublicWriteAccess​(boolean allowed)
        Set whether the public is allowed to write this object.
        参数:
        allowed - flag to allow
      • getPublicWriteAccess

        public boolean getPublicWriteAccess()
        Set whether the public is allowed to write this object.
        返回:
        public write permission.
      • setReadAccess

        public void setReadAccess​(java.lang.String userId,
                                  boolean allowed)
        Set whether the given user id is allowed to read this object.
        参数:
        userId - target user id.
        allowed - flag to allow
      • getReadAccess

        public boolean getReadAccess​(java.lang.String userId)
        Get whether the given user id is *explicitly* allowed to read this object. Even if this returns false, the user may still be able to access it if getPublicReadAccess returns true or a role that the user belongs to has read access.
        参数:
        userId - target user id.
        返回:
        result whether has read permission for specified userId.
      • setWriteAccess

        public void setWriteAccess​(java.lang.String userId,
                                   boolean allowed)
        Set whether the given user id is allowed to write this object.
        参数:
        userId - target user id.
        allowed - flag to allow.
      • getWriteAccess

        public boolean getWriteAccess​(java.lang.String userId)
        Get whether the given user id is *explicitly* allowed to write this object. Even if this returns false, the user may still be able to write it if getPublicWriteAccess returns true or a role that the user belongs to has write access.
        参数:
        userId - target user id.
        返回:
        result whether has write permission for specified userId.
      • setReadAccess

        public void setReadAccess​(LCUser user,
                                  boolean allowed)
        Set whether the given user is allowed to read this object.
        参数:
        user - target user.
        allowed - flag to allow
      • getReadAccess

        public boolean getReadAccess​(LCUser user)
        Get whether the given user is *explicitly* allowed to read this object. Even if this returns false, the user may still be able to access it if getPublicReadAccess returns true or a role that the user belongs to has read access.
        参数:
        user - target user.
        返回:
        result whether has read permission for specified user.
      • setWriteAccess

        public void setWriteAccess​(LCUser user,
                                   boolean allowed)
        Set whether the given user is allowed to write this object.
        参数:
        user - target user.
        allowed - flag to allow
      • getWriteAccess

        public boolean getWriteAccess​(LCUser user)
        Get whether the given user is *explicitly* allowed to write this object. Even if this returns false, the user may still be able to access it if getPublicWriteAccess returns true or a role that the user belongs to has write access.
        参数:
        user - target user.
        返回:
        result whether has write permission for specified user.
      • setRoleReadAccess

        public void setRoleReadAccess​(java.lang.String role,
                                      boolean allowed)
        Set whether the given role is allowed to read this object.
        参数:
        role - target role.
        allowed - flat to allow.
      • getRoleReadAccess

        public boolean getRoleReadAccess​(java.lang.String role)
        Get whether the given role is *explicitly* allowed to read this object. Even if this returns false, the role may still be able to access it if getPublicReadAccess returns
        参数:
        role - target role.
        返回:
        result whether has read permission for specified role.
      • setRoleWriteAccess

        public void setRoleWriteAccess​(java.lang.String role,
                                       boolean allowed)
        Set whether the given role is allowed to write this object.
        参数:
        role - target role.
        allowed - flat to allow.
      • getRoleWriteAccess

        public boolean getRoleWriteAccess​(java.lang.String role)
        Get whether the given role is *explicitly* allowed to write this object. Even if this returns false, the role may still be able to access it if getPublicWriteAccess returns
        参数:
        role - target role.
        返回:
        result whether has write permission for specified role.