* @param metadata
* @throws GeneralSecurityException
*/
public void doSetMetadata( String pathId, List<StringKeyStringValueDto> metadata ) throws GeneralSecurityException {
RepositoryFileDto file = getRepoWs().getFile( idToPath( pathId ) );
RepositoryFileAclDto fileAcl = getRepoWs().getAcl( file.getId() );
boolean canManage =
getSession().getName().equals( fileAcl.getOwner() )
|| ( getPolicy().isAllowed( RepositoryReadAction.NAME )
&& getPolicy().isAllowed( RepositoryCreateAction.NAME ) && getPolicy().isAllowed(
AdministerSecurityAction.NAME ) );
if ( !canManage ) {
if ( fileAcl.isEntriesInheriting() ) {
List<RepositoryFileAclAceDto> aces = getRepoWs().getEffectiveAces( file.getId() );
fileAcl.setAces( aces, fileAcl.isEntriesInheriting() );
}
for ( int i = 0; i < fileAcl.getAces().size(); i++ ) {
RepositoryFileAclAceDto acl = fileAcl.getAces().get( i );
if ( acl.getRecipient().equals( getSession().getName() ) ) {
if ( acl.getPermissions().contains( RepositoryFilePermission.ACL_MANAGEMENT.ordinal() )
|| acl.getPermissions().contains( RepositoryFilePermission.ALL.ordinal() ) ) {
canManage = true;
break;