public GetAuthorizationsResponse GetAuthorizations(GetAuthorizationsRequest request) { Platform.CheckForNullReference(request, "request"); Platform.CheckMemberIsSet(request.UserName, "UserName"); //TODO: ideally we should validate the username and session token and check session expiry //this would ensure that only a user with a valid session could obtain his authorizations, //however, there is an issue in the RIS right now that prevents the session token from being passed // in the request... this is a WCF architecture question that needs to be resolved var tokens = PersistenceContext.GetBroker <IAuthorityTokenBroker>().FindTokensByUserName(request.UserName); return(new GetAuthorizationsResponse(tokens)); }
public GetAuthorizationsResponse GetAuthorizations(GetAuthorizationsRequest request) { string[] authorities = Roles.GetRolesForUser(request.UserName); #if (STANDALONE) var list = new List <string>(); list.AddRange(authorities); list.Add(Enterprise.Authentication.AuthorityTokens.Study.ViewImages); list.Add("Viewer/Visible"); list.Add("Viewer/Clinical"); authorities = list.ToArray(); #endif return(new GetAuthorizationsResponse(authorities)); }
public GetAuthorizationsResponse GetAuthorizations(GetAuthorizationsRequest request) { string[] authorities = Roles.GetRolesForUser(request.UserName); return(new GetAuthorizationsResponse(authorities)); }