CheckAuthorizationToGetAllUsers() public static méthode

public static CheckAuthorizationToGetAllUsers ( ) : void
Résultat void
Exemple #1
0
        public Result <UserDto> Fetch(Guid id)
        {
            Result <UserDto> retResult = Result <UserDto> .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();
                DalHelper.CheckAuthorizationToGetAllUsers();

                var dto = FetchImpl(id);
                retResult = Result <UserDto> .Success(dto);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.FetchFailedException(ex);
                retResult = Result <UserDto> .FailureWithInfo(null, wrappedEx);
            }
            return(retResult);
        }
Exemple #2
0
        public Result <ICollection <UserDto> > GetAll()
        {
            Result <ICollection <UserDto> > retResult = Result <ICollection <UserDto> > .Undefined(null);

            try
            {
                Common.CommonHelper.CheckAuthentication();
                DalHelper.CheckAuthorizationToGetAllUsers();

                var allUsers = GetAllImpl();
                retResult = Result <ICollection <UserDto> > .Success(allUsers);
            }
            catch (Exception ex)
            {
                var wrappedEx = new Exceptions.GetAllFailedException(ex);
                retResult = Result <ICollection <UserDto> > .FailureWithInfo(null, wrappedEx);
            }

            return(retResult);
        }