01: /*
02: * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.search.db;
07:
08: import com.sun.portal.search.rdm.RDMException;
09: import com.sun.portal.search.soif.SOIF;
10: import java.util.Set;
11:
12: /**
13: * Interface for implementing Database Security
14: */
15: public interface DatabaseSecurityModule {
16: /**
17: * Checking the permission of an action on a given database
18: * @param st SToken
19: * @param permissionName The name of request action.
20: * @param rd A submit rd assoicated with this action.
21: * Security Module can add ReadACL if needed.
22: * @throws com.sun.portal.search.rdm.RDMException Exception
23: * @return true - if the action is allowed.
24: */
25: public boolean checkDatabasePermission(SToken st,
26: String permissionName, SOIF rd) throws RDMException;
27:
28: /**
29: * Name of this module.
30: * The name will be used in the value of a database attribute "SecurityModule"
31: * @return The name of this module
32: */
33: public String getName();
34:
35: /**
36: * Getting the roles/groups, which will be used as a filter on both search query
37: * and fetched rd filte in the ReadACL field.
38: * @param st SToken
39: * @return user's roles
40: * null - when the user has administrator privilige.
41: */
42: public Set getUserRoles(SToken st) throws Exception;
43:
44: /**
45: * Used for modifing the root db entry before it get put into root db
46: * @param dbsoif A root db entry
47: * @return true - if this module does apply.
48: */
49: public boolean onCreateCallback(SOIF dbsoif);
50:
51: }
|