![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Content Management Guide
CHAPTER 4
This chapter describes how to use ACL-based security to authorize access to Content Management (CM) subsystem elements. It has these sections:
NOTE: Most of the security tasks described in this chapter can also be accomplished using the CMS Administration Console.
For more information, see Managing Content Security.
The CM subsystem supports ACL-based security, as described in ACL-based security. You can specify access restrictions based on user ID or group membership on most objects in the CM subsystem. You can use access restrictions to:
Prevent changes after your infrastructure of document types, folders, and categories has been set up
Protect documents or other objects from being seen by unauthorized users
A comprehensive security policy must set different permissions for different user roles. Typical roles in the CM subsystem are:
Role |
Description |
---|---|
Author |
Has read and write access for documents; has read, write, and list access for folders and categories. |
Publisher |
Has publish access for documents; has list access for folders and categories. |
Administrator |
Has all access rights to all objects. Users are considered administrators when the ACL assigned to the EbiContentAdmin interface gives them at least one of the permissions. See ContentAdmin group. |
When setting up users and groups for exteNd Director, you will want to consider how your users fall into these roles and create appropriate groups. You can use those user IDs and groups to create ACLs that implement your security. You might create a master ACL that you can get and reuse throughout the CM subsystem.
You can set up users and groups using the Director Administration Console (DAC).
For more information, see the chapter on using the Directory section of the DAC in the User Management Guide.
You specify access restrictions on CM objects by using an access control list (ACL). To provide support for ACLs, exteNd Director implements the java.security.acl.Acl interface. Each of the securable elements has a set of supported access right types, or permissions. The supported permissions are defined as String constants in each object's interface.
This section describes using ACLs to specify access restrictions on CM objects.
For general information about using ACLs in exteNd Director applications, see the chapter on ACL-based security in the User Management Guide
The permissions defined for the CM subsystem include:
The table that follows lists the subsystem securable element types (not including some securable superinterfaces) and permissions they support:
The EbiContentAdmin interface represents the built-in content administrator group. Users added to this group have specified access to subsystem management and administration. Here are the available permissions:
Permission |
Description |
---|---|
PROTECT |
Set ACLs for the ContentAdmin type. |
READ |
Get subsystem elements (folders, categories and documents) in the CM subsystem |
WRITE |
Add subsystem elements to the CM subsystem |
The EbiContentMgmtDelegate interface provides access to most of the security-related methods in the CM subsystem.
These methods of EbiContentMgmtDelegate let you set security for objects:
For securable elements, you can specify an ACL when you create the object. It is an argument of the object's add method on the EbiContentMgmtDelegate — addDocument(), addFolder(), and so on.
For a code example, see Examples of adding ACLs.
For the following objects: if you don't specify an ACL when you create them, the settings of their containers are copied to the new object:
New |
Copy the ACL of their |
---|---|
Folders |
Parent folder |
Documents |
Folder |
Layout descriptors |
Layout style |
After the object is created, there is no further connection to the container's ACL. Changes to a container's ACL have no effect on the contained objects.
For other object types: if you don't specify an ACL, they have an empty ACL.
These methods on EbiContentAdmin allow you to access ACLs for the ContentAdmin group:
You can restrict access for any CM element to Content Admin users using the setRestrictedAccess() method. Specify the permission you want to restrict. For example, if you restrict access to a folder for the WRITE permission, only members of the ContentAdmin group have WRITE access to the element.
NOTE: The restricted access right takes precedence over any other ACL associated with the restricted element.
Here are the related methods on the EbiSecurityManager interface:
This example presents a method called demonstrateSecurity() that illustrates the following techniques:
Adding READ access to the ContentAdmin element associated with a principal (the identity assigned to a user as a result of authentication)
NOTE: In this case the folder inherits the ACL from its parent.
The demonstrateSecurity() method needs to access a content manager (EbiContentMgmtDelegate), the context object (EbiContext), and a principal—all of which are passed in as arguments:
public void demonstrateSecurity( EbiContentMgmtDelegate cmgr, EbiContext context, Principal principal) throws EboUnrecoverableSystemException, EboSecurityException, EboItemExistenceException, EboFactoryException, NotOwnerException { EboPermission readPerm = EboPermission.getPermission( context.getEbiSession(), EboPermission.READ); EboPermission writePerm = EboPermission.getPermission( context.getEbiSession(), EboPermission.WRITE); // Add READ access to the Content Admin element to the passed-in principal EbiContentAdmin adminElement = cmgr.getAdminElement(context); Acl admAcl = cmgr.getAcl(context, adminElement); AclEntry aclEntry = com.sssw.fw.factory.EboFactory.getAclEntry(); aclEntry.setPrincipal(principal); aclEntry.addPermission(readPerm); admAcl.addEntry(principal, aclEntry); cmgr.setAcl(context, adminElement, admAcl); // Add a folder with an ACL Acl acl = com.sssw.fw.factory.EboFactory.getAcl(); aclEntry = com.sssw.fw.factory.EboFactory.getAclEntry(); aclEntry.setPrincipal(principal); aclEntry.addPermission(readPerm); aclEntry.addPermission(writePerm); cmgr.addFolder( context, cmgr.getRootFolder(context), "Movie Reviews", EbiDocFolder.DIR_TYPE_DEFAULT, "Folder for movie reviews", acl); // Add a folder with no ACL -- it will inherit the ACL // from its parent folder (if there is an ACL set on the parent) EbiDocFolder frFolder = cmgr.addFolder( context, cmgr.getRootFolder(context), "Financial Reports", EbiDocFolder.DIR_TYPE_DEFAULT, "Folder for financial reports", null); // This code adds an ACL to an existing folder. cmgr.setAcl(context, frFolder, acl); }
This example presents a method called demonstrateHandleExceptions() that illustrates how to handle a security exception (and other exceptions as well).
This code publishes version 2 of a document whose ID is assigned to the variable docid. The publishDocumentContentVersion() method will throw an EboSecurityException if the user is not allowed to publish the specified document. This example handles the exception by adding an error message to the context object. The portlet can then include the error message in its generated content so the user knows what went wrong.
The demonstrateHandleExceptions() method needs to access a content manager (EbiContentMgmtDelegate), the context object (EbiContext), and the document of interest—all of which are passed in as arguments.
public void demonstrateHandleExceptions( EbiContentMgmtDelegate cmgr, EbiContext context, String docID) { try { cmgr.publishDocumentContentVersion(context, docID, 2, true, true); } catch (EboSecurityException se) { se.printStackTrace(); String msg = "Security violation: " + se.toString(); context.setValue("error", "User does not have access. " + msg); } catch (EboUnrecoverableSystemException use) { use.printStackTrace(); String msg = "Unrecoverable exception: " + use.toString(); context.setValue("error", msg); } catch (EboItemExistenceException iee) { iee.printStackTrace(); String msg = "Item existence exception: " + iee.toString(); context.setValue("error", msg); } } }
Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved. more ...