home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1996
- #
- # File: @(#)crud.tcl /main/titanic/6
- # Author: Marcel Bancken
- # Description: Instantiation of the security handler
- #---------------------------------------------------------------------------
- # SccsId = @(#)crud.tcl /main/titanic/6 10 Oct 1997 Copyright 1996 Cayenne Software Inc.
-
- OTShRegister::objectCustomization
-
- source [m4_path_name tcl libocl.tcl]
-
- require platform.tcl
- require procs.tcl
- require messagehdl.tcl
-
- global globalModuleHandler
- set globalModuleHandler [ModuleHandler new]
- $globalModuleHandler setCurrentContext
- require_module_file custsechan.tcl security
-
- proc setupAccess {securityHdlr} {
- set errorMsg [$securityHdlr initialize]
- if {"$errorMsg" != ""} {
- if {"$errorMsg" == "stop"} return
- $securityHdlr delete
- wmtkfatal "FATAL: $errorMsg"
- }
-
- $securityHdlr addUsers
- $securityHdlr addRoles
- $securityHdlr addUserRoleLinks
- $securityHdlr updateAccess
- }
-
- set securityHdlr [CustSecHandler new securityHdlr]
- if [[$securityHdlr project] isNil] {
- $securityHdlr delete
- wmtkfatal "FATAL: Not on project level"
- }
-
- # In order to have access control rights to the Phases
- # activate role SuperUser also on project level
- [$securityHdlr corporate] activate SuperUser
- [$securityHdlr project] activate SuperUser
-
- set argsfile [lindex $argv 0]
- if [[$securityHdlr config] isNil] {
- if {"$argsfile" == ""} {
- $securityHdlr delete
- wmtkfatal "FATAL: missing argument file"
- }
- set fid [open [lindex $argsfile 0]]
- set configs [read -nonewline $fid]
- close $fid
-
- set cc [ClientContext::global]
- foreach config $configs {
- $cc downLevel $config
- $securityHdlr config [$cc currentConfig]
- setupAccess $securityHdlr
- $cc upLevel
- }
- } else {
- setupAccess $securityHdlr
- }
-
- # Cleanup
- if {"$argsfile" != ""} {
- unlink [lindex $argsfile 0]
- }
-