fwAccessControl.ctl File Reference

Functions

void _fwAccessControl_exportDomain (dyn_string &expCmd, string domainName, dyn_string &exceptionInfo)
void _fwAccessControl_exportGroup (dyn_string &expCmd, string groupName, dyn_string &exceptionInfo)
void _fwAccessControl_exportSubGroup (dyn_string &expCmd, string groupName, dyn_string &exceptionInfo)
void _fwAccessControl_exportUser (dyn_string &expCmd, string userName, dyn_string &exceptionInfo)
string _fwAccessControl_encryptString (string s, anytype key)
string _fwAccessControl_decryptString (string encodedString, anytype key)
blob _fwAccessControl_xxTeaEncrypt (blob b, anytype key)
dyn_int _fwAccessControl_strToLong (string str)
dyn_int _fwAccessControl_blobToLong (blob b)
blob _fwAccessControl_longToBlob (dyn_int ar)
unsigned _fwAccessControl_rshift_pad (unsigned x, int n)
string _fwAccessControl_Base64EncodeBlob (blob str)
blob _fwAccessControl_Base64DecodeToBlob (string str)
blob _fwAccessControl_xxTeaDecrypt (blob b, anytype key)
dyn_string _fwAccessControl_sendCommandToServer (string cmd, dyn_string params="", int timeout=-1)
void _fwAccessControl_checkDoServerSync (dyn_string &exceptionInfo)
void _fwAccessControl_enableAccesControl (bool enabled, dyn_string &exceptionInfo)
bool _fwAccessControl_isAccessControlEnabled (dyn_string &exceptionInfo)
void fwAccessControl_cancelLogin ()
bool _fwAccessControl_ACServerAuthRoutine (string userName, string password, dyn_string &exceptionInfo)
bool _fwAccessControl_LDAPAuthRoutine (string userName, string password, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
bool fwAccessControl_checkAuth (string userName, string password, dyn_string &exceptionInfo, bool tryLocal=TRUE)
bool _fwAccessControl_PVSSAuth (string userName, string password, dyn_string &exceptionInfo)
private bool _fwAccessControl_IsACServerRunning ()
void fwAccessControl_SuspendModifications (bool suspend, dyn_string &exceptionInfo)
void _fwAccessControl_SuspendACServer (dyn_string &exceptionInfo)
void _fwAccessControl_ResumeACServer (dyn_string &exceptionInfo)
void _fwAccessControl_SuspendEgroupSync (dyn_string &exceptionInfo)
void _fwAccessControl_ResumeEgroupSync (dyn_string &exceptionInfo)
void _fwAccessControl_setBatchMode (bool mode, dyn_string &exceptionInfo)
General-Purpose functions

see also the module General-Purpose functions



void fwAccessControl_displayException (dyn_string &exceptionInfo)
void fwAccessControl_displayMessage (string message)
void fwAccessControl_raiseException (dyn_string &exceptionInfo, string title, string detail, string extraInfo="")
void fwAccessControl_help (string what)
void fwAccessControl_logout () synchronized(_fwAccessControl_mutex)
void fwAccessControl_login ()
bool _fwAccessControl_isUI ()
bool _fwAccessControl_integratedMode ()
void fwAccessControl_setupPanel (string callbackFunctionName, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
void fwAccessControl_getUserName (string &userName)
void fwAccessControl_getCurrentRole (string &currentRole)
void fwAccessControl_setRole (string role, dyn_string &exceptionInfo)
string _fwAccessControl_getManagerTypeName (char mantype)
void fwAccessControl_getDisplayInfo (int manId, string &hostName, string &ip, int &manNum, time &startTime, dyn_string &exceptionInfo)
void fwAccessControl_getMyDisplay (string &hostName, string &ip, int &manNum, time &startTime, dyn_string &exceptionInfo)
void fwAccessControl_getConfiguration (dyn_mixed &configuration, dyn_string &exceptionInfo, string sysName="")
void fwAccessControl_setConfiguration (dyn_mixed configuration, dyn_string &exceptionInfo, string sysName="")
void fwAccessControl_checkAddDomain (string domainName, dyn_string privileges, dyn_string &exceptionInfo, string domainFullName="", string domainComment="")
void fwAccessControl_checkAddGroup (string groupName, dyn_string privileges, dyn_string &exceptionInfo, string groupFullName="", string groupComment="")
void fwAccessControl_checkAddUser (string userName, dyn_string groups, dyn_string &exceptionInfo, string userFullName="", string userComment="", string userPassword="", bool enabled=TRUE, int userId=-1, bool passwordAlreadyCrypted=FALSE, bool localAccount=FALSE)
bool fwAccessControl_setUsers (dyn_string userNames, dyn_dyn_string userGroups, dyn_string userFullNames, dyn_string userComments, dyn_string userPasswords, dyn_bool usersEnabled, dyn_int &userIds, dyn_bool pwdsCrypted, dyn_bool localAccounts, int resetMode, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
bool fwAccessControl_checkPassword (string userName, string password, dyn_string &exceptionInfo)
string _fwAccessControl_generateRandomPassword ()
bool fwAccessControl_changePassword (string userName, string currentPassword, string newPassword, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
void fwAccessControl_getActiveUsers (dyn_string &users, dyn_string &uis, dyn_string &uiHosts, dyn_string &loginTimes, dyn_string &exceptionInfo, string sysName="")
void fwAccessControl_selectPrivileges (dyn_string &privileges, string text="", bool showSystemDomain=FALSE)
bool _fwAccessControl_exportToPostInstall (string fileName)
Domain-related functions

see also the module Domain manipulation functions



void fwAccessControl_getAllDomains (dyn_string &domainlist, dyn_string &fullDomainNames, dyn_string &exceptionInfo)
void fwAccessControl_deleteDomain (string domainName, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
void fwAccessControl_getDomain (string domainName, string &domainFullName, string &domainComment, int &domainId, dyn_string &privilegeNames, dyn_int &privilegeIds, dyn_string &exceptionInfo)
void fwAccessControl_createDomain (string domainName, string domainFullName, string domainComment, dyn_string privileges, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
void fwAccessControl_updateDomain (string domainName, string newDomainName, string domainFullName, string domainComment, dyn_string privileges, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
Group-related functions

see also the module Group manipulation functions



void fwAccessControl_getAllGroups (dyn_string &grouplist, dyn_string &fullGroupNames, dyn_string &exceptionInfo)
void fwAccessControl_getGroup (string groupName, string &groupFullName, string &description, int &groupId, dyn_string &exceptionInfo)
void fwAccessControl_deleteGroup (string groupName, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
void fwAccessControl_createGroup (string groupName, string groupFullName, string groupComment, dyn_string privileges, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
void fwAccessControl_updateGroup (string groupName, string newGroupName, string groupFullName, string groupComment, dyn_string privileges, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
void fwAccessControl_getGroupMembers (string groupName, dyn_string &members, dyn_string &exceptionInfo)
void fwAccessControl_resolveGroupsRecursively (dyn_string groupNames, dyn_string &includedGroups, dyn_string &includedBy, dyn_string &exceptionInfo, bool recursive=TRUE)
void fwAccessControl_getGroupsInGroup (string groupName, dyn_string &includedGroups, dyn_string &exceptionInfo, bool recursive=FALSE)
void fwAccessControl_setGroupsInGroup (string groupName, dyn_string includedGroups, dyn_string &exceptionInfo)
User-related functions

see also the module User manipulation functions



void fwAccessControl_getAllUsers (dyn_string &userlist, dyn_string &fullUserNames, dyn_string &exceptionInfo)
void fwAccessControl_getUser (string userName, string &userFullName, string &description, int &userId, bool &enabled, dyn_string &groupNames, dyn_string &exceptionInfo)
void fwAccessControl_deleteUser (string userName, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
void fwAccessControl_createUser (string userName, string userFullName, string userComment, bool enabled, string password, dyn_string groupMembership, dyn_string &exceptionInfo, int userId=-1, bool passwordAlreadyCrypted=FALSE, bool localAccount=FALSE) synchronized(_fwAccessControl_mutex)
bool fwAccessControl_isUserAccountLocal (string userName, dyn_string &exceptionInfo)
void fwAccessControl_getUserRoles (string userName, dyn_string &userRoles, dyn_int &roleLevels, dyn_string &exceptionInfo)
void fwAccessControl_updateUser (string userName, string newUserName, string userFullName, string userComment, bool enabled, string password, dyn_string groupMembership, dyn_string &exceptionInfo, bool passwordAlreadyCrypted=FALSE, bool localAccount=FALSE) synchronized(_fwAccessControl_mutex)
void fwAccessControl_enableUserAccount (string userName, bool enabled, dyn_string &exceptionInfo) synchronized(_fwAccessControl_mutex)
Permission-related functions
bool fwAccessControl_HasUserAdminPrivilege (dyn_string &exceptionInfo, string user="", bool exceptionOnNotGranted=TRUE)
bool fwAccessControl_HasGroupAdminPrivilege (dyn_string &exceptionInfo, string user="", bool exceptionOnNotGranted=TRUE)
bool fwAccessControl_HasDomainAdminPrivilege (dyn_string &exceptionInfo, string user="", bool exceptionOnNotGranted=TRUE)
bool fwAccessControl_HasSystemAdminPrivilege (dyn_string &exceptionInfo, string user="", bool exceptionOnNotGranted=TRUE)
void fwAccessControl_getGroupPrivileges (string groupName, dyn_string domainNames, dyn_string &privileges, dyn_string &exceptionInfo, bool recursively=FALSE)
void fwAccessControl_updateGroupPrivileges (string groupName, dyn_string newPrivileges, dyn_string &exceptionInfo)
void fwAccessControl_getUserPrivileges (string userName, dyn_string domainNames, dyn_string &privileges, dyn_string &exceptionInfo, bool strictRoleChecking=FALSE)
void fwAccessControl_checkUserPrivilege (string userName, string domainName, string privilegeName, bool &granted, dyn_string &exceptionInfo)
void fwAccessControl_checkUserPrivilege_AuthFunc (string userName, string domainName, string privilegeName, bool &granted, dyn_string &exceptionInfo)
void fwAccessControl_checkUserPrivilege_AuthFastFunc (string userName, string domainName, string privilegeName, bool &granted, dyn_string &exceptionInfo)
void fwAccessControl_isGranted (string domain_privilege, bool &granted, dyn_string &exceptionInfo)
void fwAccessControl_getGroupsHavingPrivilege (string domainName, string privName, dyn_string &groups, dyn_string &exceptionInfo)
void fwAccessControl_getUsersHavingPrivilege (string domainName, string privName, dyn_string &users, dyn_string &exceptionInfo)
void fwAccessControl_getPrivilegeNames (string domainName, dyn_string &privilegeNames, dyn_int &privilegeIds, dyn_string &exceptionInfo)
void fwAccessControl_setPrivilegeNames (string domainName, dyn_string privilegeNames, dyn_string &exceptionInfo)
Framework domain specific functions



void _fwAccessControl_checkInit ()

Variables

global string g_fwAccessControl_version = "5.0.10"
global bool g_fwAccessControl_initialised = FALSE
global string g_fwAccessControl_systemDomainName
global string g_fwAccessControl_systemDomainGenericName = "SYSTEM"
global string g_fwAccessControl_systemDomainFullName = "local system"
global string g_fwAccessControl_AreasDP
global string g_fwAccessControl_GroupsDP
global string g_fwAccessControl_UsersDP
global string g_fwAccessControl_WorkstationsDP
global mapping g_fwAccessControl_workstationAliases
global string g_fwAccessControl_ConfigurationDP
global string g_fwAccessControl_GroupHierarchyDP
global string g_fwAccessControl_egroupSyncDP
global string g_fwAccessControl_DefaultAdminPriv
global string g_fwAccessControl_CurrentRole
global float g_fwAccessControl_RequiredDpVersion = 3.0
const int GROUP_NAME_TO_IDX = 1
const int GROUP_IDX_TO_NAME = 2
const int DOMAIN_NAME_TO_IDX = 3
const int DOMAIN_IDX_TO_NAME = 4
const int USER_NAME_TO_IDX = 5
const int USER_IDX_TO_NAME = 6
global const bool g_fwAccessControl_ModeUNICOS = false
global string g_fwAccessControl_UnicosDP = "_fwAccessControl"
const int fwAccessControl_CONFIG_AccessRight_DomainAdmin = 1
const int fwAccessControl_CONFIG_AccessRight_GroupAdmin = 2
const int fwAccessControl_CONFIG_AccessRight_UserAdmin = 3
const int fwAccessControl_CONFIG_AccessRight_DPType = 4
const int fwAccessControl_CONFIG_AccessRight_DP = 5
const int fwAccessControl_CONFIG_AccessRight_DPAlias = 6
const int fwAccessControl_CONFIG_AccessRight_DPAuth = 7
const int fwAccessControl_CONFIG_Authentication_OsAutoLogin = 8
const int fwAccessControl_CONFIG_Authentication_ForceLogin = 9
const int fwAccessControl_CONFIG_Authentication_Configuration = 10
const int fwAccessControl_CONFIG_Authorization_StrictRoleChecking = 11
const int fwAccessControl_CONFIG_Authorization_Configuration = 12
const int fwAccessControl_CONFIG_MAX = 12
global dyn_string _fwAccessControl_currentUserAccessRights
global bool _fwAccessControl_batchMode = FALSE
global bool g_fwAccessControl_Command_Lock = FALSE

Detailed Description

JCOP Framework Access Control library

Author:
Piotr Golonka, CERN EN/ICE-SCD

Function Documentation

string _fwAccessControl_encryptString ( string  s,
anytype  key 
)

returns a string, in BASE64 encoding, containing the text passed in s , encoded with the key passed in key

string _fwAccessControl_decryptString ( string  encodedString,
anytype  key 
)
blob _fwAccessControl_xxTeaEncrypt ( blob  b,
anytype  key 
)
dyn_int _fwAccessControl_strToLong ( string  str  ) 
dyn_int _fwAccessControl_blobToLong ( blob  b  ) 
blob _fwAccessControl_longToBlob ( dyn_int  ar  ) 
unsigned _fwAccessControl_rshift_pad ( unsigned  x,
int  n 
)
string _fwAccessControl_Base64EncodeBlob ( blob  str  ) 
blob _fwAccessControl_Base64DecodeToBlob ( string  str  ) 
blob _fwAccessControl_xxTeaDecrypt ( blob  b,
anytype  key 
)
dyn_string _fwAccessControl_sendCommandToServer ( string  cmd,
dyn_string  params = "",
int  timeout = -1 
)
void _fwAccessControl_checkDoServerSync ( dyn_string &  exceptionInfo  ) 

WARNING! We cannot use _integratedMode() function! We need to test ourselves! because this is a special case where we should detect that server is running

void _fwAccessControl_enableAccesControl ( bool  enabled,
dyn_string &  exceptionInfo 
)

Enables or disables access control

When access control is disabled using this function, all users have effectively all privileges, i.e. the fwAccessControl_checkUserPrivilege and fwAccessControl_isGranted functions always indidate that the privilege is granted.

Parameters:
enabled indicated whether privilege checking should be enabled or disabled
exceptionInfo standard exception handling variable
bool _fwAccessControl_isAccessControlEnabled ( dyn_string &  exceptionInfo  ) 

checks if Access Control is enabled

Parameters:
exceptionInfo standard exception handling variable
See also:
_fwAccessControl_enableAccesControl
Returns:
TRUE if privilege-checking is active, FALSE otherwise
void fwAccessControl_cancelLogin (  ) 
bool _fwAccessControl_ACServerAuthRoutine ( string  userName,
string  password,
dyn_string &  exceptionInfo 
)
bool _fwAccessControl_LDAPAuthRoutine ( string  userName,
string  password,
dyn_string &  exceptionInfo 
)
bool fwAccessControl_checkAuth ( string  userName,
string  password,
dyn_string &  exceptionInfo,
bool  tryLocal = TRUE 
)
bool _fwAccessControl_PVSSAuth ( string  userName,
string  password,
dyn_string &  exceptionInfo 
)
private bool _fwAccessControl_IsACServerRunning (  ) 
void fwAccessControl_SuspendModifications ( bool  suspend,
dyn_string &  exceptionInfo 
)

Resume/suspend ACServer and Egroup Synchronization

The function allows to suspend various user-account synchronization mechanisms, for instance to guarantee that they are not affected during engineering processes.

Parameters:
suspend : set to TRUE to suspend and FALSE to resume
exceptionInfo standard exception handling variable
void _fwAccessControl_SuspendACServer ( dyn_string &  exceptionInfo  ) 
void _fwAccessControl_ResumeACServer ( dyn_string &  exceptionInfo  ) 
void _fwAccessControl_SuspendEgroupSync ( dyn_string &  exceptionInfo  ) 
void _fwAccessControl_ResumeEgroupSync ( dyn_string &  exceptionInfo  ) 
void _fwAccessControl_setBatchMode ( bool  mode,
dyn_string &  exceptionInfo 
)

Variable Documentation

global string g_fwAccessControl_version = "5.0.10"
const int GROUP_NAME_TO_IDX = 1
global const bool g_fwAccessControl_ModeUNICOS = false

for backward compatibility reason, yet deprecated

global string g_fwAccessControl_UnicosDP = "_fwAccessControl"
global bool _fwAccessControl_batchMode = FALSE
global bool g_fwAccessControl_Command_Lock = FALSE

Generated on 27 May 2014 for Access Control component by  doxygen 1.6.1