>

AllPermissions Property

Applies To

Container Object, Document Object.

Description

Returns all the permissions that apply to the current UserName property of the Container or Document object, including permissions that are specific to the user as well as the permissions a user inherits from memberships in groups.

Returned Values

For any Container or Document object, the returned values may include the following.

Constant

Description

dbSecReadDef

Can read the table definition including column and index information.

dbSecWriteDef

Can modify or delete the table definition including column and index information.

dbSecRetrieveData

Can retrieve data from the Document object.

dbSecInsertData

Can add records.

dbSecReplaceData

Can modify records.

dbSecDeleteData

Can delete records.


In addition, the Databases Container object or any Document object in a Documents collection may include the following.

Constant

Description

dbSecDeleteData

Can delete records.

dbSecDBAdmin

Gives user permission to make a database replicable and change the database password.

dbSecDBCreate

Can create new databases (valid only on the databases Container object in the system database [System.mdw]).

dbSecDBExclusive

Exclusive access.

dbSecDBOpen

Can open the database.


Remarks

These constants are listed in the Data Access (DAO) object library in the Object Browser.

This property contrasts with the Permissions property, which returns only the permissions that are specific to the user and doesn't include any permissions that the user may also have as a member of groups. If UserName is a group, then AllPermissions property returns the same values as Permissions.

Specifics (Microsoft Access)

Microsoft Access defines four types of Container objects in addition to those defined by the Microsoft Jet database engine. These include the Forms, Reports, Scripts, or Modules Container objects. Individual Form, Report, Script and Module Document objects belong to the Documents collections of these Container objects. For these Container and Document objects, you can also set the AllPermissions property to the following constants.

Constant

User or group can

acSecFrmRptReadDef

Open the form or report in Design view but not make any changes.

acSecFrmRptWriteDef

Modify or delete the form or report in Design view.

acSecFrmRptExecute

Open the form in Form view or Datasheet view; print or open the report in Sample Preview or Print Preview.

acSecMacReadDef

Open the Macro window and view a macro without making changes.

acSecMacWriteDef

Modify or delete the macro in the Macro window.

acSecModReadDef

Open the module but not make any changes.

acSecModWriteDef

Modify or delete the contents of a module.

acSecMacExecute

Run the macro.


Example (Microsoft Access)

The following example checks the AllPermissions property for the Forms Container object and determines whether the user specified by the UserName property has full access to forms.


Sub CheckAllPermissions()
    Dim dbs As Database, ctr As Container

    ' Return Database variable that points to current database.
    Set dbs = CurrentDb
    ' Return Container object that points to Forms container.
    Set ctr = dbs.Containers!Forms
    ' Print current value of UserName for container.
    Debug.Print ctr.UserName
    ' Check if AllPermissions property includes full access.
    If (ctr.AllPermissions And dbSecFullAccess) Then
        MsgBox "User " & ctr.UserName & " has full access to all forms."
    End If
End Sub