Stellent
HowToComponents
JavaDoc

intradoc.shared
Class UserDocumentAccessFilter

java.lang.Object
  |
  +--intradoc.shared.UserDocumentAccessFilter
All Implemented Interfaces:
IdcComparator

public class UserDocumentAccessFilter
extends java.lang.Object
implements IdcComparator

This class is used to optimize the testing of access of a user against an application entity that has document style security credentials. In order to get good performance, this class is hardwired in its understanding of groups and accounts. This class reduces flexibility when changing the implementation of security but improves the speed of execution. This class makes two assumptions: 1. The level of desired access has already been chosen (Read, Write, Deleted, or Admin). 2. All checks made with security group and account have all already been lower cased.


Field Summary
 boolean m_accessAllAccounts
          Set to true if user has access to "#all" account.
 boolean m_accessNoneAccount
          Set to true user has access to "#none" account.
 java.lang.String[] m_accounts
          Accounts (not including "#none" or "#all")
 int m_appRights
          Sub admin flags.
 java.lang.String[] m_groups
          Groups accessible (all in lower case).
 boolean m_isAdmin
          Set to true if being accessed by user with admin role.
 
Constructor Summary
UserDocumentAccessFilter(java.util.Vector groups, java.util.Vector accounts, boolean isAdmin, int appRights)
          Constructs filter with specified list of groups and accounts.
 
Method Summary
 boolean checkAccess(java.lang.String group, java.lang.String account)
          Checks to see if filter allows access to a security group and account.
 boolean checkStringListEqual(java.lang.String[] list1, java.lang.String[] list2)
          Checks to see if two string arrays are identical.
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares to strings, used as callback interface for sorting.
 boolean isEqualSecurity(UserDocumentAccessFilter filter)
          Checks to see if this filter will filter the same documents as another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_isAdmin

public boolean m_isAdmin
Set to true if being accessed by user with admin role.


m_appRights

public int m_appRights
Sub admin flags. Control access to admin applications.


m_groups

public java.lang.String[] m_groups
Groups accessible (all in lower case).


m_accounts

public java.lang.String[] m_accounts
Accounts (not including "#none" or "#all")


m_accessNoneAccount

public boolean m_accessNoneAccount
Set to true user has access to "#none" account.


m_accessAllAccounts

public boolean m_accessAllAccounts
Set to true if user has access to "#all" account.

Constructor Detail

UserDocumentAccessFilter

public UserDocumentAccessFilter(java.util.Vector groups,
                                java.util.Vector accounts,
                                boolean isAdmin,
                                int appRights)
Constructs filter with specified list of groups and accounts.

Method Detail

isEqualSecurity

public boolean isEqualSecurity(UserDocumentAccessFilter filter)
Checks to see if this filter will filter the same documents as another.


checkStringListEqual

public boolean checkStringListEqual(java.lang.String[] list1,
                                    java.lang.String[] list2)
Checks to see if two string arrays are identical.


checkAccess

public boolean checkAccess(java.lang.String group,
                           java.lang.String account)
Checks to see if filter allows access to a security group and account. The security group and account must have already be in lower case.


compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares to strings, used as callback interface for sorting.

Specified by:
compare in interface IdcComparator


(c) 1996-2005  All rights reserved.  Stellent, Inc.