コード例 #1
0
        /// <summary>
        /// Validates if user has a certain permission
        /// </summary>
        /// <param name="permission">Id of permission</param>
        /// <returns>true if user has permission, false if not</returns>
        public bool HasUserPermission(Permission permission)
        {
            Permission tmp_permission = db.GetRolePermissionById((int)Global.employee.Role, (int)permission);

            if (tmp_permission.Equals(permission))
            {
                return(true);
            }

            return(false);
        }