home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
rolerights.tcl
< prev
next >
Wrap
Text File
|
1997-04-22
|
4KB
|
128 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)rolerights.tcl /main/titanic/4
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)rolerights.tcl /main/titanic/4 22 Apr 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require_module_file "accesscont.tcl" security
Class RoleRightsDlg : {AccessControlDlg} {
constructor
method destructor
method selectedObjectSetChanged
method selectedRoleSetChanged
method selectedRoleRightTypeChanged
method updateActionsIf
}
constructor RoleRightsDlg {class this name} {
set this [AccessControlDlg::constructor $class $this $name]
# Start constructor user section
# End constructor user section
return $this
}
method RoleRightsDlg::destructor {this} {
# Start destructor user section
# End destructor user section
$this AccessControlDlg::destructor
}
method RoleRightsDlg::selectedObjectSetChanged {this} {
$this AccessControlDlg::selectedObjectSetChanged
$this updateRoleRightTypeIf
$this updateActionsIf
}
method RoleRightsDlg::selectedRoleSetChanged {this} {
$this AccessControlDlg::selectedRoleSetChanged
$this updateActionsIf
}
method RoleRightsDlg::selectedRoleRightTypeChanged {this} {
$this AccessControlDlg::selectedRoleRightTypeChanged
$this updateActionsIf
}
method RoleRightsDlg::updateActionsIf {this} {
set roleList [$this.top.row.leftCol.roles.list selectedSet]
if [lempty $roleList] {
$this AccessControlDlg::updateActionsIf
return
}
set objectIndexList [$this.top.row.leftCol.objects.list selectedIndexSet]
set doChildRight 0
set type ownRights
if [$this childRights] {
set type [$this.top.row.leftCol.ruleType.row.type selected]
if {"$type" == "childRight"} {
set doChildRight 1
set actionList "[BrowserProcs::action2String 1023]"
} else {
set doChildRight 0
}
}
global $this$type
foreach index $objectIndexList {
set obj [[$this selectedSet] index $index]
if {! $doChildRight} {
set controlledActions [$obj controlledActions]
set actionList [BrowserProcs::action2String $controlledActions]
}
foreach action $actionList {
set actionIf $this.top.row.rightCol.actions.col.$action
$actionIf.label sensitive 1
$actionIf.access sensitive [$this editable]
}
foreach role $roleList {
foreach action $actionList {
if [info exists ${this}${type}($index,$role,$action)] {
case "[set ${this}${type}($index,$role,$action)]" in {
Allowed {
set allowed [$this getAllowed $action]
$this setAllowed $action [incr allowed]
}
Prohibited {
set prohibited [$this getProhibited $action]
$this setProhibited $action [incr prohibited]
}
}
}
}
if $doChildRight {
set roleRight [$obj findNewChildRight "$role"]
} else {
set roleRight [$obj findRight "$role"]
}
if {! [$roleRight isA RoleRight]} continue
foreach action \
[BrowserProcs::action2String [$roleRight allowedActions]] {
if [info exists ${this}${type}($index,$role,$action)] continue
set allowed [$this getAllowed $action]
$this setAllowed $action [incr allowed]
}
foreach action \
[BrowserProcs::action2String [$roleRight prohibitedActions]] {
if [info exists ${this}${type}($index,$role,$action)] continue
set prohibited [$this getProhibited $action]
$this setProhibited $action [incr prohibited]
}
}
}
$this AccessControlDlg::updateActionsIf
}
# Do not delete this line -- regeneration end marker