Microsoft KB Archive/142093

= ACC: Permissions and AllPermissions Properties =

Article ID: 142093

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q142093



SUMMARY
Advanced: Requires expert coding, interoperability, and multiuser skills.

The Permissions property returns only the explicit permissions that are granted to the current user. These permissions do not include the implicit permissions that the user inherits because the user is also a member of group accounts.

The AllPermissions property returns all the permissions that apply to the current user, including permissions that are specific to the user as well as the permissions a user inherits from membership in groups.

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.



MORE INFORMATION
There are two levels of accounts in Microsoft Access 7.0 and 97: individual user accounts and group level accounts. Explicit permissions are permissions that are granted directly to the individual user account. The user account is identified by a user name and a personal identifier (PID). Implicit permissions are permissions that are granted to a group account. A group account is a collection of user accounts in a workgroup. A group account is identified by a group name and personal identifier. Permissions assigned to a group apply to all users in the group.

You can check the permissions an individual user has by following these steps:  Open the sample database Northwind.mdb. On the Tools menu, click Security, and then click User And Group Permissions. In the User And Group Permissions dialog box, under Permissions, set the permissions for the Admin user to Open/Run. Under Object Name, select Orders Subform, and under Object Type, select Form.  Enter the following sample code into a new module. Function ShowPermissions Dim dbsNorthwind As DATABASE, docTest As Document Set dbsNorthwind = CurrentDb Set docTest = dbsNorthwind.Containers(1).Documents("Orders _           SubForm") Debug.Print docTest.Permissions End Function  Press CTRL+G to open the Debug Window, type ?ShowPermissions, and then press ENTER. Note the value returned in the Debug window. Replace the reference, doctest.Permissions, in the code in step 4 with the following reference: doctest.AllPermissions. Type ?ShowPermissions in the Debug window again, and press ENTER. Note that a different value is returned.</li></ol>

The AllPermissions property returns the set of the permissions the user inherits from each of the groups the user belongs to, in addition to the explicit permissions granted directly to the individual user account. A user's security level is always the least restrictive of that user's explicit permissions and the permissions of any and all groups to which that user belongs.

The quickest and easiest way to administer a workgroup is to create new groups and assign permissions to the groups rather than to individual users. Then you can easily change permissions for a user by simply moving the user to a new group. You can also change permissions to an entire group in a single operation, which is much easier than for each individual user.

<div class="references_section">