Content Studio Web Content Management System
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
true if the caller has the desired permission, false otherwise.
This version of the call checks the caller's permission on the specified object
The following sample shows how to check if the calling user has permission to create and write new documents in the current category.
[This is preliminary documentation and is subject to change.]
Checks if a user has a certain permission on a Content Studio object.
Namespace: ContentStudio.Security
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax
public bool ObjectAccessCheck( ConnectionId connectionId, SessionId sessionId, CSObjectPermissions accessMask, CSSecurableObjects objectType, int objectId )
Parameters
- connectionId
- Type: ContentStudioConnectionId
A value that identifies the web site - sessionId
- Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId). - accessMask
- Type: ContentStudio.SecurityCSObjectPermissions
An access mask that specifies the permission to check - objectType
- Type: ContentStudio.SecurityCSSecurableObjects
A member in the CSSecurableObjects enumeration that indicates the type of object to check access for. - objectId
- Type: SystemInt32
A value that identifies the object to check
Return Value
Type: Booleantrue if the caller has the desired permission, false otherwise.
Exceptions
Exception | Condition |
---|---|
CSInvalidSessionException | The session is invalid |
CSException | A business rule was violated in the underlying Content Studio database |
SqlException | An error occurred when executing the command against the Content Studio database |
Remarks
Examples
try { AccessControl acc = new AccessControl(); if(acc.ObjectAccessCheck(CS_ConnectionId, CS_UserSessionId, CSObjectPermissions.Create | CSObjectPermissions.Write, CSSecurableObjects.DocumentCategory, CS_InsertedCategoryId)) Response.Write("You have access!"); else Response.Write("Sorry, no access for you!"); } catch (Exception ex) { Response.Write(Server.HtmlEncode(ex.GetType().ToString() + ": " + ex.Message)); }
See Also