Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000214.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: Permissions Trigger</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000213.html" title="TTE/BUCS" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000215.html" title="Permissions Trigger" />
17
18    
19
20    
21
22    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
23 </head>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
25    <div id="container">
26       <div id="container-inner" class="pkg">
27
28          <div id="banner">
29             <div id="banner-inner" class="pkg">
30                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
31                <h2 id="banner-description">Searchable status reports and work log</h2>
32             </div>
33          </div>
34
35          <div id="pagebody">
36             <div id="pagebody-inner" class="pkg">
37                <div id="alpha">
38                   <div id="alpha-inner" class="pkg">
39
40                      <p class="content-nav">
41                         <a href="http://defaria.com/blogs/Status/archives/000213.html">&laquo; TTE/BUCS</a> |
42                         <a href="http://defaria.com/blogs/Status/">Main</a>
43                         | <a href="http://defaria.com/blogs/Status/archives/000215.html">Permissions Trigger &raquo;</a>
44                      </p>
45
46                      <a id="a000214"></a>
47                      <div class="entry" id="entry-214">
48                         <h3 class="entry-header">Permissions Trigger</h3>
49                         <div class="entry-content">
50                            <div class="entry-body">
51                               <p>I've given the "permissions trigger" some thought and would like to formalize the requirements a bit. The new trigger will have the following characteristics:</p>
52
53 <ul>
54
55 <li>Since multiple groups will be allowed write access to the vob they will need to be added as additional groups on the vob group list. </li>
56
57 <li>Determination of what users get additional write capability will be on Active Directory groups. IOW you can grant write access to say the CC-PMO group but not specifically to Mike Hrenko who is a member of the CC-PMO group. Additionally CC-PMO would need to appear on the vob group list in this example.</li>
58  
59 <li>The trigger will use CLEARCASE_PRIMARY_GROUP to determine what group the user is. This avoids having to do LDAP lookups and it's the way that Clearcase does it anyway. CLEARCASE_PRIMARY_GROUP will not be used verbatim - if it were then anybody would "fake" out the trigger by merely setting CLEARCASE_PRIMARY_GROUP. Instead "creds" will be called to ascertain the effective primary group.</li>
60
61 <li>A permissions element will be created that will contain a list of groups, one per line, that are allowed write access from this folder downward. The vob's initial or primary group owner (CC-TTE in the case of Core_automation) will always have write permission. Furthermore the permissions element should be secured such that only vob's primary group owner can modify it. Otherwise other groups could easily modify the permissions element thus granting write permissions to arbitrary groups.</li>
62
63 </ul>
64
65 <p>Let's see an example of how this will work and how the trigger will respond. Let's assume the following directory structure:</p>
66
67 <blockquote>
68   Core_automation 
69   <blockquote>
70     Empower <font color="#eeeeee">CC-EAG-AS, CC-EAG-ESB</font>
71     <blockquote>
72       Functions <font color="#eeeeee">CC-EAG-VIP</font><br>
73       Results <font color="#eeeeee">CC-EAG-VMS</font><br>
74       Common
75     </blockquote>
76   </blockquote>
77 </blockquote>
78
79 <p>Further let's assume that the permissions element is at the Empower level and contains the groups CC-EAG-AS and CC-EAG-ESB. This says that those two groups (as well as CC-TTE as primary group owners of the vob) have write permission (the ability to checkout) elements from Core_automation/Empower downward. Additionally let's say that we have a permissions element at Empower/Functions that lists CC-EAG-VIP and Empower/Results has a permissions element that lists CC-EAG-VMS. The following can be said:</p>
80
81 <ul>
82
83 <li>Members of CC-EAG-AS and CC-EAG-ESB have write permissions to Empower, Empower/Functions, Empower/Results and Empower/Common. Further, if new folders are created under Empower, CC-EAG-AS and CC-EAG-ESB will have write permissions to those new folders as well (IOW the write permissions are inherited by new folders that are created)</li>
84
85 <li>Members of CC-EAG-VIP have write permissions to Empower/Functions and any new folders created under Functions, but they do not have write permissions to Empower/Results nor Empower/Common. Similarly CC-EAG-VMS has write permissions to Empower/Results but not to Empower/Functions nor Empower/Common</li>
86
87 </ul>
88
89 <p>The pseudo code for the trigger is roughly as follows. Note that the trigger gets fired during checkout of an element only (it is assumed if the user successfully checked out the element then, at the time, he had write permissions and should be allowed to check in the element):</p>
90
91 <div class="code">
92 <pre>
93 $vob_group_owner = GetGroupOwner (vob) 
94 $current_group   = GetCurrentGroup (CLEARCASE_PRIMARY_GROUP as per "creds") 
95
96 if (permissions element exists in the current folder) { 
97   if (IsAMember (Parse ($permissions_element), $current_group) {
98     &lt;<i>allow checkout</i>&gt;
99   } else { 
100     &lt;<i>recurse to check parent folder stopping at vob root</i>&gt; 
101     &lt;<i>disallow checkout</i>&gt;
102   } 
103 }
104 </pre>
105 </div>
106                            </div>
107                            <div id="more" class="entry-more">
108                               
109                            </div>
110                         </div>
111                         <p class="entry-footer">
112                            <span class="post-footers">Posted by  on July 19, 2004  3:07 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000214.html">Permalink</a>
113                         </p>
114                      </div>
115
116                      
117
118                      
119                   </div>
120                </div>
121             </div>
122          </div>
123       </div>
124    </div>
125 </body>
126 </html>