47 lines
1.5 KiB
Java
47 lines
1.5 KiB
Java
package eu.dnetlib.repo.manager.service.security;
|
|
|
|
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
|
|
|
public interface AaiUserRoleService {
|
|
|
|
/**
|
|
* @param fullName
|
|
* @param prefix
|
|
* @return
|
|
*/
|
|
String getRepoNameWithoutType(String fullName, String prefix);
|
|
|
|
/**
|
|
* @param repoId Repository Id
|
|
* @return Converts {@param repoId} to a role Id.
|
|
*/
|
|
String getRoleIdByRepoId(String repoId);
|
|
|
|
/**
|
|
* @param repoId Repository Id
|
|
* @return
|
|
*/
|
|
String convertRepoIdToAuthorityId(String repoId);
|
|
|
|
/**
|
|
* @param repoId Repository Id
|
|
* @return Converts {@param repoId} to {@link String} role id url encoded ($ -> %24)
|
|
* // TODO: remove role encoding and perform url decoding when mapping authorities. (Must be performed in all OpenAIRE projects because of Redis)
|
|
*/
|
|
String convertRepoIdToEncodedAuthorityId(String repoId);
|
|
|
|
/**
|
|
* @param repoId Repository Id
|
|
* @return Converts {@param repoId} to {@link SimpleGrantedAuthority} with the role url encoded ($ -> %24)
|
|
* // TODO: remove role encoding and perform url decoding when mapping authorities. (Must be performed in all OpenAIRE projects because of Redis)
|
|
*/
|
|
SimpleGrantedAuthority convertRepoIdToAuthority(String repoId);
|
|
|
|
/**
|
|
* @param repoId Repository Id to check.
|
|
* @return Checks if a user is a member of a repository or not.
|
|
*/
|
|
boolean isMemberOf(String repoId);
|
|
|
|
}
|