コード例 #1
0
 public static bool Show(User user, Models.Dissertation dissertation)
 {
     if (dissertation != null)
     {
         if (user == null)
         {
             if (!dissertation.Defensed || dissertation.Administrative_Use)
                 return false;
         }
         else
         {
             if ((user is Applicant) && (user.Id != dissertation.Id))
                 if (!dissertation.Defensed || dissertation.Administrative_Use)
                     return false;
         }
         return true;
     }
     return false;
 }
コード例 #2
0
 // Добавляет метод по заданию информации об авторизованном пользователе
 public static void SetUser(this HttpSessionStateBase session, User user)
 {
     session["User"] = user;
 }
コード例 #3
0
 public static bool Edit(User user) { return ((user is Administrator) || ((user is Member) && (((user as Member).Position == MemberPosition.Chairman) || ((user as Member).Position == MemberPosition.Secretary)))); }
コード例 #4
0
 public static bool Create(User user) { return ((user is Administrator) || ((user is Member) && ((user as Member).Position == MemberPosition.Secretary))); }
コード例 #5
0
 public static bool Control(User user, Models.Dissertation dissertation) { return ((user is Applicant) && (dissertation != null) && ((user as Applicant).Id == dissertation.Id)); }
コード例 #6
0
 public static bool Control(User user) { return ((user is Administrator) || ((user is Member) && ((user as Member).Position == MemberPosition.Chairman))); }
コード例 #7
0
 public static bool ChangeChairman(User user) { return (user is Administrator); }
コード例 #8
0
 public static bool Edit(User user, Models.Dissertation dissertation) { return ((user is Applicant) && (user.Id == dissertation.Applicant.Id)); }
コード例 #9
0
 public static bool ShowAdditionalInfo(User user) { return ((user is Member) || (user is Administrator)); }
コード例 #10
0
 public static bool ShowAdditionalInfo(User user, User showedUser)
 {
     if ((user == null) || (showedUser == null)) return false;
     return ((user.Id == showedUser.Id) || (user is Member) || (user is Administrator));
 }
コード例 #11
0
 public static bool Remove(User user, User removedUser)
 {
     if ((user == null) || (removedUser == null)) return false;
     return ((user is Administrator) || (user.Id == removedUser.Id) || ((user is Member) && ((user as Member).Position == MemberPosition.Chairman) && !(removedUser is Administrator)));
 }
コード例 #12
0
 public static bool Remove(User user) { return (user is Administrator); }
コード例 #13
0
 public static bool Edit(User user, User editedUser)
 {
     if ((user == null) || (editedUser == null)) return false;
     return ((user.Id == editedUser.Id) || (user is Administrator) || (((user is Member) && ((user as Member).Position == MemberPosition.Chairman) && !(editedUser is Administrator))));
 }
コード例 #14
0
 public static bool RegisterAdministrator(User user) { return (user is Administrator); }
コード例 #15
0
 public static bool RegisterApplicant(User user) { return ((user == null)  || ((user is Member) && ((user as Member).Position == MemberPosition.Secretary))); }