home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
usrdbobj.tcl
< prev
next >
Wrap
Text File
|
1997-10-16
|
4KB
|
135 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)usrdbobj.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)usrdbobj.tcl /main/titanic/3 16 Oct 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
# End user added include file section
require_module_file "userroleob.tcl" security
Class UsrDbObj : {User UserRoleObj} {
method destructor
constructor
method addUserRoleLinks
method makeUpToDate
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::makeUpToDate {this} {
# dummy call to server
$this roleLinks
}
method UsrDbObj::roleLinks {this} {
return [$this User::roleLinks [[$this info] set SecurityLevel]]
}
# Do not delete this line -- regeneration end marker