示例#1
0
 /// <summary>
 /// Проверить, что пользователь вошёл систему
 /// </summary>
 public void CheckLoggedOn()
 {
     if (!UserMonitor.UserIsLoggedOn(WebOperationContext.Current))
     {
         throw new ScadaException(WebPhrases.NotLoggedOn);
     }
 }
示例#2
0
 /// <summary>
 /// Проверить, что пользователь вошёл систему, и получить его права
 /// </summary>
 /// <remarks>Метод используется, если сессия не доступна</remarks>
 public bool CheckLoggedOn(out UserRights userRights, bool throwOnFail = true)
 {
     if (UserMonitor.UserIsLoggedOn(WebOperationContext.Current, out userRights))
     {
         return(true);
     }
     else if (throwOnFail)
     {
         throw new ScadaException(WebPhrases.NotLoggedOn);
     }
     else
     {
         return(false);
     }
 }