Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 // Добавляет метод по заданию информации об авторизованном пользователе
 public static void SetUser(this HttpSessionStateBase session, User user)
 {
     session["User"] = user;
 }
Ejemplo n.º 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)))); }
Ejemplo n.º 4
0
 public static bool Create(User user) { return ((user is Administrator) || ((user is Member) && ((user as Member).Position == MemberPosition.Secretary))); }
Ejemplo n.º 5
0
 public static bool Control(User user, Models.Dissertation dissertation) { return ((user is Applicant) && (dissertation != null) && ((user as Applicant).Id == dissertation.Id)); }
Ejemplo n.º 6
0
 public static bool Control(User user) { return ((user is Administrator) || ((user is Member) && ((user as Member).Position == MemberPosition.Chairman))); }
Ejemplo n.º 7
0
 public static bool ChangeChairman(User user) { return (user is Administrator); }
Ejemplo n.º 8
0
 public static bool Edit(User user, Models.Dissertation dissertation) { return ((user is Applicant) && (user.Id == dissertation.Applicant.Id)); }
Ejemplo n.º 9
0
 public static bool ShowAdditionalInfo(User user) { return ((user is Member) || (user is Administrator)); }
Ejemplo n.º 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));
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 12
0
 public static bool Remove(User user) { return (user is Administrator); }
Ejemplo n.º 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))));
 }
Ejemplo n.º 14
0
 public static bool RegisterAdministrator(User user) { return (user is Administrator); }
Ejemplo n.º 15
0
 public static bool RegisterApplicant(User user) { return ((user == null)  || ((user is Member) && ((user as Member).Position == MemberPosition.Secretary))); }