File: uiedit_acls.vspx

package info (click to toggle)
virtuoso-opensource 7.2.12%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 299,308 kB
  • sloc: ansic: 655,054; sql: 508,209; xml: 269,573; java: 84,064; javascript: 79,847; cpp: 37,662; sh: 32,429; cs: 25,702; php: 12,690; yacc: 11,666; lex: 7,933; makefile: 7,308; jsp: 4,523; awk: 1,719; perl: 1,013; ruby: 1,003; python: 326
file content (103 lines) | stat: -rw-r--r-- 4,243 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="UTF-8"?>
<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2024 OpenLink Software
 -
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -
-->
<v:page name="acl-sharing"
        fast-render="1"
        xmlns:vm="http://www.openlinksw.com/vspx/ods/"
        xmlns:v="http://www.openlinksw.com/vspx/"
        style="index.xsl"
        doctype="-//W3C//DTD XHTML 1.0 Transitional//EN"
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <v:before-data-bind>
    <![CDATA[
      select deserialize (WAUI_ACL)
        into self.iAcl
        FROM DB.DBA.WA_USER_INFO
       where WAUI_U_ID = self.u_id;
    ]]>
  </v:before-data-bind>
  <v:variable name="iAcl" type="any" default="null" persist="0" />
  <h3>Profile Sharing</h3>
  <table>
    <tr>
      <td width="100%">
        <table id="s_tbl" class="listing" style="width: 100%;" cellspacing="0">
          <thead>
            <tr class="listing_header_row">
              <th width="1%" nowrap="nowrap">Access Type</th>
              <th nowrap="nowrap">WebID</th>
              <th width="1%" align="center" nowrap="nowrap">ACL: (R)ead, (W)rite</th>
              <th width="1%">Action</th>
            </tr>
          </thead>
          <tbody id="s_tbody">
          <tr id="s_tr_no"><td colspan="4"><b>No WebID Security</b></td></tr>
    		  <![CDATA[
    		    <script type="text/javascript">
            <?vsp
              declare N integer;

              for (N := 0; N < length (self.iAcl); N := N + 1)
              {
                  http (sprintf ('ODSInitArray.push(function(){TBL.createRow("s", null, {fld_1: {mode: 50, value: "%s", onchange: function(){TBL.changeCell50(this);}}, fld_2: {mode: 51, className: "_validate_ _webid_", value: %s, readOnly: %s, imgCssText: "%s"}, fld_3: {mode: 52, value: [%d, %d, %d], tdCssText: "width: 1%%; text-align: center;"}});});', self.iacl[N][2], ODS..obj2json (self.iacl[N][1]), case when self.iacl[N][2] = 'public' then 'true' else 'false' end, case when self.iacl[N][2] = 'public' then 'display: none;' else '' end, self.iacl[N][3], self.iacl[N][4], self.iacl[N][5]));
              }
            ?>
    		    </script>
    		  ]]>
          </tbody>
        </table>
      </td>
      <td valign="top" nowrap="nowrap">
        <span class="button pointer" onclick="javascript: TBL.createRow('s', null, {fld_1: {mode: 50, onchange: function(){TBL.changeCell50(this);}}, fld_2: {mode: 51, className: '_validate_ _webid_'}, fld_3: {mode: 52, value: [1, 0, 0], tdCssText: 'width: 1%; text-align: center;'}});"><img src="/ods/images/icons/add_16.png" border="0" class="button" alt="Add Security" title="Add Security" /> Add</span><br /><br />
      </td>
    </tr>
  </table>
  <v:button name="btn_acl_update" action="simple" value="Update" xhtml_class="form-button">
    <v:on-post>
      <![CDATA[
        declare exit handler for SQLSTATE '*'
        {
          -- dbg_obj_print ('__SQL_MESSAGE', __SQL_MESSAGE);
          if (__SQL_STATE = 'TEST')
          {
            self.vc_error_message := ODRIVE.WA.test_clear (__SQL_MESSAGE);
            self.vc_is_valid := 0;
            return;
          }
          resignal;
        };

        -- validate ACL rules
        DB.DBA.wa_aci_validate (DB.DBA.wa_aci_params (e.ve_params));

        self.iAcl := DB.DBA.wa_aci_params (e.ve_params);
        WA_USER_EDIT (self.u_name, 'WAUI_ACL', serialize (self.iAcl));

        self.vc_data_bind(e);
      ]]>
    </v:on-post>
  </v:button>

</v:page>