0022904: Clean up sccsid variables
[occt.git] / src / OSD / OSD_Protection.cdl
1
2 --Copyright:      Matra Datavision 1992,1993
3
4 -- File:          OSD_Protection.cdl
5 -- Created:       Tue 18 1992
6 -- Author:        Stephan GARNAUD (ARM)
7 --                <sga@sparc4>
8
9
10
11 class Protection from OSD 
12
13   ---Purpose: This  class provides data to manage file protection
14   --  Example:These rights are treated in a system dependent manner :
15   --          On UNIX you have User,Group and Other rights
16   --          On VMS  you have Owner,Group,World and System rights
17   --          An automatic conversion is done between OSD and UNIX/VMS.
18   --           
19   --          OSD       VMS     UNIX
20   --          User     Owner   User
21   --          Group    Group   Group
22   --          World    World   Other
23   --          System   System  (combined with Other)
24   -- 
25   --          When you use System protection on UNIX you must know that
26   --          Other rights and System rights are inclusively "ORed". 
27   --          So Other with only READ access and System with WRITE access
28   --          will produce on UNIX Other with READ and WRITE access.
29   --
30   --          This choice comes from the fact that ROOT can't be considered
31   --          as member of the group nor as user. So it is considered as Other.
32
33
34  uses SingleProtection, AsciiString from TCollection
35
36
37  is
38   Create returns Protection;
39    ---Purpose: Initializes global access rights as follows
40    --
41    --          User   : Read Write
42    --          System : Read Write
43    --          Group  : Read
44    --          World  : Read
45    ---Level: Public
46   
47   Create (System , 
48     User , Group , World : SingleProtection) returns Protection;
49     ---Purpose: Sets values of fields
50     ---Level: Public
51
52   Values (me : in out; 
53     System , User , Group , World : out SingleProtection) is static;
54     ---Purpose: Retrieves values of fields
55     ---Level: Public
56
57   SetValues (me : in out;  
58     System , User , Group , World : SingleProtection) is static;
59     ---Purpose: Sets values of fields
60     ---Level: Public
61
62   SetSystem(me : in out; priv : SingleProtection) is static;
63     ---Purpose: Sets protection of 'System'
64     ---Level: Public
65
66   SetUser(me : in out; priv : SingleProtection) is static;
67     ---Purpose: Sets protection of 'User'
68     ---Level: Public
69
70   SetGroup(me : in out; priv : SingleProtection) is static;
71     ---Purpose: Sets protection of 'Group'
72     ---Level: Public
73
74   SetWorld(me : in out; priv : SingleProtection) is static;
75     ---Purpose: Sets protection of 'World'
76     ---Level: Public
77
78   System(me ) returns SingleProtection is static;
79     ---Purpose: Gets protection of 'System'
80     ---Level: Public
81
82   User(me ) returns SingleProtection is static;
83     ---Purpose: Gets protection of 'User'
84     ---Level: Public
85
86   Group(me ) returns SingleProtection is static;
87     ---Purpose: Gets protection of 'Group'
88     ---Level: Public
89
90   World(me ) returns SingleProtection is static;
91     ---Purpose: Gets protection of 'World'
92     ---Level: Public
93
94   Internal (me) returns Integer  is static private;
95     ---Purpose: Returns System dependent access rights
96     --          this is a private method.
97     ---Level: Public
98
99   Add (me : in out ;
100     aProt : in out SingleProtection ;aRight : SingleProtection) is static;
101     ---Purpose: Add a right to a single protection.
102     --          ex: aProt = RWD
103     --              me.Add(aProt,X)  ->  aProt = RWXD
104     ---Level: Public
105
106   Sub (me : in out ;
107     aProt : in out SingleProtection ;aRight : SingleProtection) is static;
108    ---Purpose: Subtract a right to a single protection.
109    --           ex: aProt = RWD
110    --               me.Sub(aProt,RW) ->  aProt = D
111    --               But me.Sub(aProt,RWX) is also valid and gives same result.
112    ---Level: Public
113
114
115  fields
116   s : SingleProtection;  -- System right
117   u : SingleProtection;  -- User right
118   g : SingleProtection;  -- Group right
119   w : SingleProtection;  -- World right
120
121 friends class FileNode, class File, class Directory
122
123 end Protection from OSD;
124
125