hasPermission() method added (as configured template API extension) to Template API

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5377 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-03-12 15:12:56 +00:00
parent 200d170489
commit 5e1b1c1189
2 changed files with 17 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ import org.alfresco.service.cmr.audit.AuditInfo;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.lock.LockStatus;
import org.alfresco.service.cmr.security.AccessPermission;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.cmr.version.VersionHistory;
import org.alfresco.service.namespace.QName;
@@ -676,6 +677,16 @@ public class TemplateNode implements Serializable
return this.services.getPermissionService().getInheritParentPermissions(this.nodeRef);
}
/**
* @param permission Permission name to test
*
* @return true if the current user is granted the specified permission on the node
*/
public boolean hasPermission(String permission)
{
return (this.services.getPermissionService().hasPermission(this.nodeRef, permission) == AccessStatus.ALLOWED);
}
// ------------------------------------------------------------------------------
// Search API