home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)usrdbobj.tcl /main/hindenburg/1
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)usrdbobj.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 UsrDbObj : {User UserRoleObj} {
- method destructor
- constructor
- method addUserRoleLinks
- method roleLinks
- }
-
- method UsrDbObj::destructor {this} {
- # Start destructor user section
- # End destructor user section
- $this UserRoleObj::destructor
- }
-
- constructor UsrDbObj {class this name} {
- set this [User::constructor $class $this $name]
- set this [UserRoleObj::constructor $class $this $name]
- return $this
- }
-
- selfPromoter User {this} {
- UsrDbObj promote $this
- }
-
- method UsrDbObj::addUserRoleLinks {this} {
- set typeSpec [getObjectSpec [$wmttoolObj objectHdlr] Role ""]
- if {"$typeSpec" != ""} {
- set icon [$typeSpec smallIcon]
- } else {
- set icon ""
- }
-
- foreach role [$this roles [$this getParent SecurityLevel]] {
- set currentList($role) 1
- }
- set objectSpecList ""
- set roleList ""
- foreach role [[$this getParent Corporate] roles] {
- if [info exists currentList($role)] continue
- lappend objectSpecList [list $icon [$role name]]
- lappend roleList $role
- }
-
- if [lempty $objectSpecList] {
- wmtkinfo "There are no roles 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 Role(s) to create a link to" \
- -headerSpecList {{Name 20 ascii {increasing 1}}} \
- -objectSpecList $objectSpecList \
- -objectList $roleList \
- -dbObj $this \
- -cancelPressed {%this delete} \
- -okPressed {
- set user [%this dbObj]
- set userName [$user name]
- set securityLevel [$user getParent SecurityLevel]
- set script ""
- set message "Creating link(s) from user '$userName' to role"
- foreach object [[%this view] selectedSet] {
- set role [$object object]
- if {"$script" != ""} {
- append script " ;"
- append message ","
- }
- append script " $securityLevel createUserRoleLink \
- $userName $role defaultOff"
- append message " '[$role name]'"
- }
- $wmttoolObj startCommand tcl "$script" "" "$message" {1 0} 1
- %this delete
- }
- $box popUp
- }
-
- proc UsrDbObj::associations {} {
- return {roleLinks}
- }
-
- proc UsrDbObj::childTypes {assoc} {
- if {[lsearch -exact "[UsrDbObj::associations]" "$assoc"] == -1} {
- return ""
- }
- set childTypes [BrowserProcs::childTypes $assoc]
- case "$childTypes" in {
- {UserRoleLink} {
- return {RoleLink}
- }
- {default} {
- return "$childTypes"
- }
- }
- }
-
- proc UsrDbObj::controlledLists {} {
- return ""
- }
-
- proc UsrDbObj::infoProperties {} {
- return [BrowserProcs::infoProperties]
- }
-
- method UsrDbObj::roleLinks {this} {
- return [$this User::roleLinks [[$this info] set SecurityLevel]]
- }
-
- # Do not delete this line -- regeneration end marker
-
-