Class ::xo::db::sql::acs_permission (public)
::xo::db::Class ::xo::db::sql::acs_permission
Defined in
- Testcases:
-
No testcase defined.
Source code:
namespace eval ::xo::db::sql {}
::nsf::object::alloc ::xo::db::Class ::xo::db::sql::acs_permission {set :__default_metaclass ::xotcl::Class
set :__default_superclass ::xotcl::Object
set :abstract_p f
set :auto_save false
set :name_method {}
set :object_type ::xo::db::sql::acs_permission
set :security_inherit_p t
set :sql_package_name acs_permission
set :supertype acs_object
set :with_table true}
::xo::db::sql::acs_permission proc permission_p {{-dbn {}} -object_id:required -party_id:required -privilege:required} {
foreach var [list OBJECT_ID PARTY_ID PRIVILEGE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_permission__permission_p($_OBJECT_ID, $_PARTY_ID, $_PRIVILEGE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_permission proc revoke_permission {{-dbn {}} -object_id:required -grantee_id:required -privilege:required} {
foreach var [list OBJECT_ID GRANTEE_ID PRIVILEGE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_permission__revoke_permission($_OBJECT_ID, $_GRANTEE_ID, $_PRIVILEGE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_permission proc grant_permission {{-dbn {}} -object_id:required -grantee_id:required -privilege:required} {
foreach var [list OBJECT_ID GRANTEE_ID PRIVILEGE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_permission__grant_permission($_OBJECT_ID, $_GRANTEE_ID, $_PRIVILEGE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
::xo::db::sql::acs_permission proc permission_p_recursive_array {{-dbn {}} -objects:required -party_id:required -privilege:required} {
foreach var [list OBJECTS PARTY_ID PRIVILEGE] {
set varname [string tolower $var]
if {[info exists $varname]} {
set $var [set $varname]
set _$var :$var
} else {
set _$var null
}
}
set sql "
select acs_permission__permission_p_recursive_array($_OBJECTS, $_PARTY_ID, $_PRIVILEGE)
"
db_with_handle -dbn $dbn db {
return [ ns_set value [ns_pg_bind 0or1row $db $sql] 0 ]
}
}
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]