Algorithm 1. The algorithm of permission availability detection. |
Input: Permission element urij, 1 ≤ i ≤ m, 1 ≤ j ≤ n |
Output: Permissions available or unavailable |
Result = Available; // The result is initialized to available rights. for i = 1:m, do for x = i + 1:m do for j = 1:n do for y = j + 1:n do if urij = urxy or IsPartof(urij, urxy) then // The two permission elements are equal or contain result = Available; return result; else if (urij ≠ urxy)then result = NotAvailable; end if end for end for end for end for return result |