home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
roledbobj.tcl
< prev
next >
Wrap
Text File
|
1997-10-16
|
3KB
|
131 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)roledbobj.tcl /main/titanic/3
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)roledbobj.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 RoleDbObj : {UserRoleObj Role} {
method destructor
constructor
method addUserRoleLinks
method makeUpToDate
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::makeUpToDate {this} {
# dummy call to server
$this userLinks
}
method RoleDbObj::userLinks {this} {
return [$this Role::userLinks [[$this info] set SecurityLevel]]
}
# Do not delete this line -- regeneration end marker