# -
# This test verifies that the COM IAccessControl implementation can handle a large number
# of ACEs
# -

# Initialize a new ACL
Exec InitNewACL

# Add rayland\actest1-10 to the local access request list
ToggleAccessPerm COM_RIGHTS_EXECUTE
Set TrusteeName rayland\actest1
AddTrustee AccessRequestList
Set TrusteeName rayland\actest2
AddTrustee AccessRequestList
Set TrusteeName rayland\actest3
AddTrustee AccessRequestList
Set TrusteeName rayland\actest4
AddTrustee AccessRequestList
Set TrusteeName rayland\actest5
AddTrustee AccessRequestList
Set TrusteeName rayland\actest6
AddTrustee AccessRequestList
Set TrusteeName rayland\actest7
AddTrustee AccessRequestList
Set TrusteeName rayland\actest8
AddTrustee AccessRequestList
Set TrusteeName rayland\actest9
AddTrustee AccessRequestList
Set TrusteeName rayland\actest10
AddTrustee AccessRequestList

# Call GrantAccessRights
Exec GrantAccessRights

# Take a look at the ACL
Exec GetExplicitAccessRights

# Change Client's security context
SwitchClientCtx
actest10
rayland

# Call IsAccessPermitted
Exec IsAccessPermitted

# Call DenyAccessRights
Exec DenyAccessRights

# Take a look at the ACL
Exec GetExplicitAccessRights

# Call IsAccessPermitted
Exec IsAccessPermitted

# Revoke actest2,4,6,8,10
Set TrusteeName rayland\actest2
AddTrustee TrusteeList
Set TrusteeName rayland\actest4
AddTrustee TrusteeList
Set TrusteeName rayland\actest6
AddTrustee TrusteeList
Set TrusteeName rayland\actest8
AddTrustee TrusteeList
Set TrusteeName rayland\actest10
AddTrustee TrusteeList

# Call RevokeExplictAccessRights
Exec RevokeExplicitAccessRights

# Take a look at the ACL
Exec GetExplicitAccessRights

# Call IsAccessPermitted
Exec IsAccessPermitted

# Destroy the old access request list
Destroy AccessRequestList

# Add rayland\actest10 to the access request list
AddTrustee AccessRequestList

# Call GrantAccessRights
Exec GrantAccessrights

# Take a look at the ACL
Exec GetExplicitAccessRights

# Call IsAccessPermitted
Exec IsAccessPermitted

# Kill the server
Quit

