Example #1
0
        public static bool IsUserAllowed(int userID, int contentID, PermissionTypes permissionType, ContentTypes contentType)
        {
            int permissionTypeID = permissionType.ToInt();
            int contentTypeID    = contentType.ToInt();

            return(db.Permissions.Any(
                       p =>
                       p.PermissionTypeID >= permissionTypeID &&
                       p.ContentTypeID == contentTypeID &&
                       p.ContentID == contentID &&
                       p.GrantedUserID == userID
                       ));
        }