Esempio n. 1
0
 private void EvaluateUserPermissions( IUser user, SecurityPermittedAccess requestedAccess)
 {
     user.IdentifyWindowsUser();
     if (user.IsAuthenticated)
     {
         switch (requestedAccess)
         {
             case SecurityPermittedAccess.PayerFeeBatchCreate:
                 {
                     StringCollection allowedRoles = Properties.Settings.Default.SecurityPayerFeeBatchCreate;
                     user.IsAuthorizedPayerFeeBatchCreate = user.AuthorizeAction(allowedRoles);
                     if (!user.IsAuthorizedPayerFeeBatchCreate)
                     {
                         UserNotAuthorizedException ex = new UserNotAuthorizedException("User not authorized to complete task.");
                         ErrorHandler(ex);
                     }
                     break;
                 }
         }
        }
     else
     {
         UserNotAuthorizedException ex = new UserNotAuthorizedException("User could not be properly identified to complete task.");
         ErrorHandler(ex);
     }
 }