mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -71,6 +71,12 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="hasPermissionTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.HasPermissionMethod">
|
||||
<property name="extensionName">
|
||||
<value>hasPermission</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="messageTemplateExtension" parent="baseTemplateImplementation" class="org.alfresco.repo.template.I18NMessageMethod">
|
||||
<property name="extensionName">
|
||||
<value>message</value>
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user