1 17 package org.alfresco.repo.security.permissions.impl.model; 18 19 import org.alfresco.repo.security.permissions.PermissionEntry; 20 import org.alfresco.repo.security.permissions.PermissionReference; 21 import org.alfresco.service.cmr.repository.NodeRef; 22 import org.alfresco.service.cmr.security.AccessStatus; 23 import org.alfresco.service.namespace.NamespacePrefixResolver; 24 import org.dom4j.Attribute; 25 import org.dom4j.Element; 26 27 public class GlobalPermissionEntry implements XMLModelInitialisable, PermissionEntry 28 { 29 private static final String AUTHORITY = "authority"; 30 31 private static final String PERMISSION = "permission"; 32 33 private String authority; 34 35 private PermissionReference permissionReference; 36 37 public GlobalPermissionEntry() 38 { 39 super(); 40 } 42 43 public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel) 44 { 45 Attribute authorityAttribute = element.attribute(AUTHORITY); 46 if(authorityAttribute != null) 47 { 48 authority = authorityAttribute.getStringValue(); 49 } 50 Attribute permissionAttribute = element.attribute(PERMISSION); 51 if(permissionAttribute != null) 52 { 53 permissionReference = permissionModel.getPermissionReference(null, permissionAttribute.getStringValue()); 54 } 55 56 } 57 58 public String getAuthority() 59 { 60 return authority; 61 } 62 63 public PermissionReference getPermissionReference() 64 { 65 return permissionReference; 66 } 67 68 public NodeRef getNodeRef() 69 { 70 return null; 71 } 72 73 public boolean isDenied() 74 { 75 return false; 76 } 77 78 public boolean isAllowed() 79 { 80 return true; 81 } 82 83 public AccessStatus getAccessStatus() 84 { 85 return AccessStatus.ALLOWED; 86 } 87 88 } 89 | Popular Tags |