home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
rolerights.tcl
< prev
next >
Wrap
Text File
|
1996-05-29
|
4KB
|
123 lines
#---------------------------------------------------------------------------
#
# (c) Westmount Technology 1994
#
# File: @(#)rolerights.tcl 1.7
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)rolerights.tcl 1.7 26 Mar 1996 Copyright 1994 Westmount Technology
# Start user added include file section
# End user added include file section
require "accesscont.tcl"
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 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 actionList [$obj getInfo "Controlled Actions"]
}
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