Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Sanity Check Index DDL scrips
Arguments Source

IS_USER_ORG_ADMIN

DDL script

Arguments:

NameData TypeDefault ValueIn/Out
USER_ID_INNUMBER(38) IN

Returns:

NUMBER(38)

Source

Legend: comment string keyword reserved word operator
     1: function
     2: is_user_org_admin
     3: (
     4:     user_id_in IN number
     5: )
     6: return number
     7: is
     8:     org_id_val		number;
     9:     app_group_val	number;
    10:     org_admin           number;
    11: begin
    12:     select org_id into org_id_val
    13:       from web_contact
    14:      where id = user_id_in;
    15:     select id into app_group_val
    16:       from rhnUserGroup
    17:      where org_id = org_id_val
    18:        and group_type = (
    19: 		select	id
    20: 		from	rhnUserGroupType
    21: 		where	label = 'org_admin'
    22: 	   );
    23:     select count(1) into org_admin
    24:       from rhnUserGroupMembers
    25:      where user_group_id = app_group_val
    26:        and user_id = user_id_in;
    27:    return org_admin;
    28: end;