1 13 package info.magnolia.cms.core; 14 15 import java.text.MessageFormat ; 16 17 import info.magnolia.cms.security.AccessDeniedException; 18 import info.magnolia.cms.security.AccessManager; 19 import info.magnolia.cms.security.PermissionImpl; 20 21 22 26 public final class Access { 27 28 31 private Access() { 32 } 34 35 41 public static void isGranted(AccessManager manager, String path, long permissions) throws AccessDeniedException { 42 if (manager != null && !manager.isGranted(path, permissions)) { 43 throw new AccessDeniedException(MessageFormat.format("User not allowed to {0} path [{1}]", new Object []{PermissionImpl.getPermissionAsName(permissions), path})); 45 } 46 } 47 } 48 | Popular Tags |