Exemplo n.º 1
0
        private void VerifyCredentialsForUserBlock(string token)
        {
            User executingUser = UserUtillities.GetExecutingUserIfLoggedIn(token, _sessionRepository);

            if (!_permissionManager.HasPermission(executingUser, Action.BlockUser))
            {
                throw new ForbiddenAccessException();
            }
        }
Exemplo n.º 2
0
        public LoggedUserDto Logout(string token)
        {
            Session session = UserUtillities.GetCurrentSession(token, _sessionRepository);

            _userManager.ValidateSession(session);

            _sessionRepository.Delete(session);

            return(_objectMapper.Map <LoggedUserDto>(session));
        }
Exemplo n.º 3
0
        public List <ActionDto> GetActionsOf(string token)
        {
            User executingUser = UserUtillities.GetExecutingUserIfLoggedIn(token, _sessionRepository);

            return(_objectMapper.Map <List <ActionDto> >(executingUser.PermittedActions));
        }