Exemple #1
0
        // transformer /////////////////////////////

        public static MissingAuthorizationDto fromInfo(MissingAuthorization info)
        {
            MissingAuthorizationDto dto = new MissingAuthorizationDto();

            dto.PermissionName = info.ViolatedPermissionName;
            dto.ResourceId     = info.ResourceId;
            dto.ResourceName   = info.ResourceType;

            return(dto);
        }
Exemple #2
0
        // transformer /////////////////////////////

        public static AuthorizationExceptionDto fromException(AuthorizationException e)
        {
            AuthorizationExceptionDto dto = new AuthorizationExceptionDto();

            dto.Message = e.Message;
            dto.Type    = typeof(AuthorizationException).Name;

            dto.UserId = e.UserId;
            dto.MissingAuthorizations = MissingAuthorizationDto.fromInfo(e.MissingAuthorizations);
            dto.PermissionName        = e.ViolatedPermissionName;
            dto.ResourceId            = e.ResourceId;
            dto.ResourceName          = e.ResourceType;

            return(dto);
        }