Class UsersService
java.lang.Object
org.qubership.atp.auth.springbootstarter.services.UsersService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteObjectPermissions(String entityName, UUID projectId, UUID objectId) Delete permissions for object by ID.voiddeleteObjectPermissionsBulk(String entityName, UUID projectId, List<UUID> objectIds) Delete all objects by object IDs.getObjectName(String entityName, UUID objectId) Return name of entity in "serviceName-entityName-Id" format.getObjectPermissionsForService(UUID projectId) Get object permissions for the service inside the project.getPermissionsByObjectId(String entityName, UUID projectId, UUID objectId) Get object permissions for the entity inside the project.getPermissionsByProjectId(UUID projectId) Get User Permissions for project identified by id.getUsersByProject(UUID projectId) ReturnProjectwith user lists.getUsersInfoByProjectId(UUID projectId, List<UUID> userIds) Get UserInfo by Project ID and list of User IDs.Grants all rights to provided users for the object.saveObjectPermissions(String entityName, UUID projectId, UUID objectId, Map<UUID, Operations> assignedUsers) Save users with permissions to object permissions.voidsendEntities(ServiceEntities serviceEntities) Sends service entities to the atp-users.
-
Constructor Details
-
UsersService
public UsersService()
-
-
Method Details
-
getUsersByProject
ReturnProjectwith user lists.- Parameters:
projectId- UUID of a project- Returns:
Project
-
getPermissionsByProjectId
Get User Permissions for project identified by id.- Parameters:
projectId- UUID of a project- Returns:
- User Permissions for the project.
-
sendEntities
public void sendEntities(ServiceEntities serviceEntities) throws com.fasterxml.jackson.core.JsonProcessingException Sends service entities to the atp-users.- Parameters:
serviceEntities- service entities to send.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
getPermissionsByObjectId
@Cacheable("auth_objects") public Map<String,Map<UUID, getPermissionsByObjectIdOperations>> (String entityName, UUID projectId, UUID objectId) Get object permissions for the entity inside the project.- Parameters:
entityName- String name of an entityprojectId- UUID of a projectobjectId- UUID of an object- Returns:
- Map of permissions.
-
getObjectPermissionsForService
Get object permissions for the service inside the project.- Parameters:
projectId- UUID of a project- Returns:
- Map of permissions.
-
getUsersInfoByProjectId
Get UserInfo by Project ID and list of User IDs.- Parameters:
projectId- UUID of a projectuserIds- List of user UUIDs- Returns:
- List of UserInfo objects.
-
saveObjectPermissions
public ObjectPermissions saveObjectPermissions(String entityName, UUID projectId, UUID objectId, Map<UUID, Operations> assignedUsers) throws ExceptionSave users with permissions to object permissions.- Parameters:
projectId- UUID of a projectobjectId- UUID of an objectassignedUsers- Map of user permissions- Returns:
- saved object permissions.
- Throws:
Exception
-
grantAllPermissions
public ObjectPermissions grantAllPermissions(String entityName, UUID projectId, UUID objectId, List<UUID> assignedUsers) throws Exception Grants all rights to provided users for the object.- Parameters:
projectId- UUID of a projectobjectId- UUID of an objectassignedUsers- List of user UUIDs- Returns:
- saved object permissions.
- Throws:
Exception
-
deleteObjectPermissions
Delete permissions for object by ID.- Parameters:
entityName- String entity nameprojectId- UUID of a projectobjectId- UUID of an object.
-
deleteObjectPermissionsBulk
Delete all objects by object IDs.- Parameters:
entityName- String entity nameprojectId- UUID of a projectobjectIds- List of object UUIDs.
-
getObjectName
Return name of entity in "serviceName-entityName-Id" format.- Parameters:
entityName- String entity nameobjectId- UUID of an object- Returns:
- String name calculated.
-