home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / programy / komix / DATA.Z / showaccess.tcl < prev    next >
Text File  |  1996-05-29  |  2KB  |  76 lines

  1. #---------------------------------------------------------------------------
  2. #
  3. #      (c)     Westmount Technology    1994
  4. #
  5. #      File:           @(#)showaccess.tcl    1.5
  6. #      Author:         <generated>
  7. #      Description:
  8. #---------------------------------------------------------------------------
  9. # SccsId = @(#)showaccess.tcl    1.5   26 Mar 1996 Copyright 1994 Westmount Technology
  10.  
  11. # Start user added include file section
  12. # End user added include file section
  13.  
  14. require "accesscont.tcl"
  15.  
  16. Class ShowAccessRightsDlg : {AccessControlDlg} {
  17.     constructor
  18.     method destructor
  19.     method popUp
  20.     method selectedObjectSetChanged
  21.     method updateLabel
  22. }
  23.  
  24. constructor ShowAccessRightsDlg {class this name} {
  25.     set this [AccessControlDlg::constructor $class $this $name]
  26.     # Start constructor user section
  27.  
  28.     $this editable 0
  29.  
  30.     # End constructor user section
  31.     return $this
  32. }
  33.  
  34. method ShowAccessRightsDlg::destructor {this} {
  35.     # Start destructor user section
  36.     # End destructor user section
  37.     $this AccessControlDlg::destructor
  38. }
  39.  
  40. method ShowAccessRightsDlg::popUp {this} {
  41.     $this createObjectsIf
  42.     $this createActionsIf
  43.     $this updateLabel
  44.     $this selectedObjectSetChanged
  45.     $this TemplateDialog::popUp
  46. }
  47.  
  48. method ShowAccessRightsDlg::selectedObjectSetChanged {this} {
  49.     $this AccessControlDlg::selectedObjectSetChanged
  50.  
  51.     foreach id [$this.top.row.leftCol.objects.list selectedIndexSet] {
  52.     set obj [[$this selectedSet] index $id]
  53.     foreach action [$obj getInfo "Controlled Actions"] {
  54.         set actionIf $this.top.row.rightCol.actions.col.$action
  55.         $actionIf.label sensitive 1
  56.         if [$obj hasPermission $action] {
  57.         set allowed [$this getAllowed $action]
  58.         $this setAllowed $action [expr $allowed + 1]
  59.         } else {
  60.         set prohibited [$this getProhibited $action]
  61.         $this setProhibited $action [expr $prohibited + 1]
  62.         }
  63.     }
  64.     }
  65.  
  66.     $this updateActionsIf
  67. }
  68.  
  69. method ShowAccessRightsDlg::updateLabel {this} {
  70.     set label "Effective context:  [BrowserProcs::effectiveRoles]\n"
  71.     $this.top.label text "$label"
  72. }
  73.  
  74. # Do not delete this line -- regeneration end marker
  75.  
  76.