Ejemplo n.º 1
0
        /// <summary>
        /// Sets whether the given role are allowed to write this object.
        /// </summary>
        /// <param name="role">The role.</param>
        /// <param name="value">Whether the role has access.</param>
        public void SetRoleWriteAccess(LCRole role, bool value)
        {
            if (role == null)
            {
                throw new ArgumentNullException(nameof(role));
            }
            string roleKey = $"{RoleKeyPrefix}{role.Name}";

            SetAccess(WriteAccess, roleKey, value);
        }
Ejemplo n.º 2
0
        public void SetRoleReadAccess(LCRole role, bool value)
        {
            if (role == null)
            {
                throw new ArgumentNullException(nameof(role));
            }
            string roleKey = $"{RoleKeyPrefix}{role.ObjectId}";

            SetAccess(readers, roleKey, value);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Detects whether the given role are allowed to write this object.
        /// </summary>
        /// <param name="role">The role to check.</param>
        /// <returns></returns>
        public bool GetRoleWriteAccess(LCRole role)
        {
            if (role == null)
            {
                throw new ArgumentNullException(nameof(role));
            }
            string roleKey = $"{RoleKeyPrefix}{role.Name}";

            return(GetAccess(WriteAccess, roleKey));
        }
Ejemplo n.º 4
0
        public bool GetRoleReadAccess(LCRole role)
        {
            if (role == null)
            {
                throw new ArgumentNullException(nameof(role));
            }
            string roleKey = $"{RoleKeyPrefix}{role.ObjectId}";

            return(GetAccess(readers, roleKey));
        }