home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)roledbobj.tcl /main/hindenburg/1
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)roledbobj.tcl /main/hindenburg/1 8 Oct 1996 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
- require "userroleob.tcl"
-
- Class RoleDbObj : {UserRoleObj Role} {
- method destructor
- constructor
- method addUserRoleLinks
- method userLinks
- }
-
- method RoleDbObj::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this UserRoleObj::destructor
- }
-
- constructor RoleDbObj {class this name} {
- set this [Role::constructor $class $this $name]
- set this [UserRoleObj::constructor $class $this $name]
- return $this
- }
-
- selfPromoter Role {this} {
- RoleDbObj promote $this
- }
-
- method RoleDbObj::addUserRoleLinks {this} {
- set typeSpec [getObjectSpec [$wmttoolObj objectHdlr] User ""]
- if {"$typeSpec" != ""} {
- set icon [$typeSpec smallIcon]
- } else {
- set icon ""
- }
-
- foreach user [$this users [$this getParent SecurityLevel]] {
- set currentList($user) 1
- }
- set objectSpecList ""
- foreach user [[$this getParent Corporate] users] {
- if [info exists currentList($user)] continue
- lappend objectSpecList [list $icon [$user name]]
- }
-
- if [lempty $objectSpecList] {
- wmtkinfo "There are no users to create a link to"
- return
- }
-
- require "browsviewd.tcl"
- set box $wmttoolObj.newUserRoleL
- ClassMaker::extend BrowsViewDialog NewUserRoleLBrowsViewDialog dbObj
- NewUserRoleLBrowsViewDialog new $box \
- -title "New User Role Link(s)" \
- -message "Select User(s) to create a link to" \
- -headerSpecList {{Name 20 ascii {increasing 1}}} \
- -objectSpecList $objectSpecList \
- -dbObj $this \
- -cancelPressed {%this delete} \
- -okPressed {
- set role [%this dbObj]
- set securityLevel [$role getParent SecurityLevel]
- set script ""
- set message "Creating link(s) from role '[$role name]' to user"
- foreach object [[%this view] selectedSet] {
- set userName [$object label]
- if {"$script" != ""} {
- append script " ;"
- append message ","
- }
- append script " $securityLevel createUserRoleLink \
- $userName $role defaultOff"
- append message " '$userName'"
- }
- $wmttoolObj startCommand tcl "$script" "" "$message" {1 0} 1
- %this delete
- }
- $box popUp
- }
-
- proc RoleDbObj::associations {} {
- return {userLinks}
- }
-
- proc RoleDbObj::childTypes {assoc} {
- if {[lsearch -exact "[RoleDbObj::associations]" "$assoc"] == -1} {
- return ""
- }
- set childTypes [BrowserProcs::childTypes $assoc]
- case "$childTypes" in {
- {UserRoleLink} {
- return {UserLink}
- }
- {default} {
- return "$childTypes"
- }
- }
- }
-
- proc RoleDbObj::controlledLists {} {
- return ""
- }
-
- proc RoleDbObj::infoProperties {} {
- return [BrowserProcs::infoProperties]
- }
-
- method RoleDbObj::userLinks {this} {
- return [$this Role::userLinks [[$this info] set SecurityLevel]]
- }
-
- # Do not delete this line -- regeneration end marker
-
-