home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cayenne Software Inc. 1997
- #
- # File: @(#)showaccess.tcl /main/titanic/5
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)showaccess.tcl /main/titanic/5 21 Oct 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 ShowAccessRightsDlg : {AccessControlDlg} {
- constructor
- method destructor
- method popUp
- method selectedObjectSetChanged
- method updateLabel
- }
-
- constructor ShowAccessRightsDlg {class this name} {
- set this [AccessControlDlg::constructor $class $this $name]
- # Start constructor user section
-
- $this editable 0
- $this delCancelButton
-
- # End constructor user section
- return $this
- }
-
- method ShowAccessRightsDlg::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this AccessControlDlg::destructor
- }
-
- method ShowAccessRightsDlg::popUp {this} {
- if {! [[$this selectedSet] empty]} {
- $this createObjectsIf
- $this createActionsIf
- $this updateLabel
- $this selectedObjectSetChanged
- $this TemplateDialog::popUp
- }
- if {"[$this errorStack]" != ""} {
- wmtkinfo [$this errorStack]
- $this errorStack ""
- }
- }
-
- method ShowAccessRightsDlg::selectedObjectSetChanged {this} {
- $this AccessControlDlg::selectedObjectSetChanged
-
- foreach id [$this.top.row.leftCol.objects.list selectedIndexSet] {
- set obj [[$this selectedSet] index $id]
- foreach action [$obj getInfo "Controlled Actions"] {
- set actionIf $this.top.row.rightCol.actions.col.$action
- $actionIf.label sensitive 1
- if [$obj hasPermission $action] {
- set allowed [$this getAllowed $action]
- $this setAllowed $action [expr $allowed + 1]
- } else {
- set prohibited [$this getProhibited $action]
- $this setProhibited $action [expr $prohibited + 1]
- }
- }
- }
-
- $this updateActionsIf
- }
-
- method ShowAccessRightsDlg::updateLabel {this} {
- set label "Effective context: [BrowserProcs::effectiveRoles]\n"
- $this.top.label text "$label"
- }
-
- # Do not delete this line -- regeneration end marker
-
-