Пример #1
0
 internal static SecurityResult CheckAccountActive()
 {
     //
     SecurityResult result = new SecurityResult();
     // check account
     result.ResultCode = SecurityContext.CheckAccount(DemandAccount.IsActive);
     //
     if (result.ResultCode == 0)
         result.Success = true;
     // return
     return result;
 }
Пример #2
0
 internal static SecurityResult CheckAccountIsAdminOrReseller()
 {
     SecurityResult result = new SecurityResult();
     // check account
     if (SecurityContext.User.IsInRole(SecurityContext.ROLE_ADMINISTRATOR) ||
         SecurityContext.User.IsInRole(SecurityContext.ROLE_RESELLER))
     {
         result.Success = true;
         return result;
     }
     //
     result.Success = false;
     result.ResultCode = EcommerceErrorCodes.ERROR_INSUFFICIENT_USER_ROLE;
     // return
     return result;
 }