| 1 |
294 |
jeremybenn |
-- CA110041.A
|
| 2 |
|
|
--
|
| 3 |
|
|
-- Grant of Unlimited Rights
|
| 4 |
|
|
--
|
| 5 |
|
|
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
|
| 6 |
|
|
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
|
| 7 |
|
|
-- unlimited rights in the software and documentation contained herein.
|
| 8 |
|
|
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
|
| 9 |
|
|
-- this public release, the Government intends to confer upon all
|
| 10 |
|
|
-- recipients unlimited rights equal to those held by the Government.
|
| 11 |
|
|
-- These rights include rights to use, duplicate, release or disclose the
|
| 12 |
|
|
-- released technical data and computer software in whole or in part, in
|
| 13 |
|
|
-- any manner and for any purpose whatsoever, and to have or permit others
|
| 14 |
|
|
-- to do so.
|
| 15 |
|
|
--
|
| 16 |
|
|
-- DISCLAIMER
|
| 17 |
|
|
--
|
| 18 |
|
|
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
|
| 19 |
|
|
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
|
| 20 |
|
|
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
|
| 21 |
|
|
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
|
| 22 |
|
|
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
|
| 23 |
|
|
-- PARTICULAR PURPOSE OF SAID MATERIAL.
|
| 24 |
|
|
--*
|
| 25 |
|
|
--
|
| 26 |
|
|
-- OBJECTIVE:
|
| 27 |
|
|
-- See CA110042.AM
|
| 28 |
|
|
--
|
| 29 |
|
|
-- TEST DESCRIPTION:
|
| 30 |
|
|
-- See CA110042.AM
|
| 31 |
|
|
--
|
| 32 |
|
|
-- TEST FILES:
|
| 33 |
|
|
-- The following files comprise this test:
|
| 34 |
|
|
--
|
| 35 |
|
|
-- CA110040.A
|
| 36 |
|
|
-- => CA110041.A
|
| 37 |
|
|
-- CA110042.AM
|
| 38 |
|
|
--
|
| 39 |
|
|
-- CHANGE HISTORY:
|
| 40 |
|
|
-- 06 Dec 94 SAIC ACVC 2.0
|
| 41 |
|
|
-- 26 Apr 96 SAIC ACVC 2.1: Modified prologue.
|
| 42 |
|
|
--
|
| 43 |
|
|
--!
|
| 44 |
|
|
|
| 45 |
|
|
package CA110040.CA110041 is -- Child Package Computer_System.Manager
|
| 46 |
|
|
|
| 47 |
|
|
type User_Account is new Account with private;
|
| 48 |
|
|
|
| 49 |
|
|
procedure Initialize_User_Account (Acct : out User_Account);
|
| 50 |
|
|
|
| 51 |
|
|
private
|
| 52 |
|
|
|
| 53 |
|
|
-- The private portion of this spec demonstrates that components contained
|
| 54 |
|
|
-- in the visible part of the parent are directly visible in the private
|
| 55 |
|
|
-- part of a public child.
|
| 56 |
|
|
|
| 57 |
|
|
type Account_Access_Type is (None, Guest, User, System);
|
| 58 |
|
|
|
| 59 |
|
|
type User_Account is new Account with -- Parent type.
|
| 60 |
|
|
record
|
| 61 |
|
|
Privilege : Account_Access_Type := None;
|
| 62 |
|
|
end record;
|
| 63 |
|
|
|
| 64 |
|
|
System_Account : User_Account :=
|
| 65 |
|
|
(User_ID => Administrator_Account.User_ID, -- Parent constant.
|
| 66 |
|
|
Privilege => System); -- User_ID has been
|
| 67 |
|
|
-- set to 1.
|
| 68 |
|
|
Auditor_Account : User_Account :=
|
| 69 |
|
|
(User_ID => Next_Available_ID, -- Parent function.
|
| 70 |
|
|
Privilege => System); -- User_ID has been
|
| 71 |
|
|
-- set to 2.
|
| 72 |
|
|
Total_Authorized_Accounts : System_Account_Capacity
|
| 73 |
|
|
renames Total_Accounts; -- Parent object.
|
| 74 |
|
|
|
| 75 |
|
|
Unauthorized_Account : exception
|
| 76 |
|
|
renames Illegal_Account; -- Parent exception
|
| 77 |
|
|
|
| 78 |
|
|
end CA110040.CA110041; -- Child Package Computer_System.Manager
|
| 79 |
|
|
|
| 80 |
|
|
--=================================================================--
|
| 81 |
|
|
|
| 82 |
|
|
-- Child Package body Computer_System.Manager
|
| 83 |
|
|
package body CA110040.CA110041 is
|
| 84 |
|
|
|
| 85 |
|
|
function Account_Limit_Reached return Boolean is
|
| 86 |
|
|
begin
|
| 87 |
|
|
if Total_Authorized_Accounts = Maximum_System_Accounts then
|
| 88 |
|
|
return (True);
|
| 89 |
|
|
else
|
| 90 |
|
|
return (False);
|
| 91 |
|
|
end if;
|
| 92 |
|
|
end Account_Limit_Reached;
|
| 93 |
|
|
---------------------------------------------------------------
|
| 94 |
|
|
function Valid_Account (Acct : User_Account) return Boolean is
|
| 95 |
|
|
Result : Boolean := False;
|
| 96 |
|
|
begin
|
| 97 |
|
|
if (Acct.User_ID /= System_Account.User_ID) and
|
| 98 |
|
|
(Acct.User_ID /= Auditor_Account.User_ID)
|
| 99 |
|
|
then
|
| 100 |
|
|
Result := True;
|
| 101 |
|
|
end if;
|
| 102 |
|
|
return (Result);
|
| 103 |
|
|
end Valid_Account;
|
| 104 |
|
|
---------------------------------------------------------------
|
| 105 |
|
|
procedure Initialize_User_Account (Acct : out User_Account) is
|
| 106 |
|
|
begin
|
| 107 |
|
|
if Account_Limit_Reached then
|
| 108 |
|
|
raise Account_Limit_Exceeded;
|
| 109 |
|
|
else
|
| 110 |
|
|
Acct.User_ID := Next_Available_ID;
|
| 111 |
|
|
Acct.Privilege := User;
|
| 112 |
|
|
end if;
|
| 113 |
|
|
if not Valid_Account (Acct) then
|
| 114 |
|
|
raise Unauthorized_Account;
|
| 115 |
|
|
end if;
|
| 116 |
|
|
end Initialize_User_Account;
|
| 117 |
|
|
|
| 118 |
|
|
end CA110040.CA110041; -- Child Package body Computer_System.Manager
|