cancel
Showing results for 
Search instead for 
Did you mean: 

Permission in Unity API

Manikanadanbe
Star Contributor
Star Contributor

Dear All,

How to check the create and delete a document permission for a user based on the document type in Unity API?

If anybody share the sample code much appreciated...

1 ACCEPTED ANSWER

Daniel_Quill
Elite Collaborator
Elite Collaborator

You will need create the DocumentType object and use something similar to

if(docType.CanI(DocumentTypePrivileges.DocumentDeletion))
{
   ... DO WORK ...
}

This should return a Boolean value based on whether access is available.  You may need to consult your company's OnBase API certified co-workers for additional assistance or contact your first line of support.

View answer in original post

4 REPLIES 4

Grant_Fish
Confirmed Champ
Confirmed Champ

Use the CanI method of the DocumentType object. CanI accepts a member of the DocumentTypePrivileges enumeration.

For your purposes, you will probably want to check DocumentTypePrivileges.DocumentCreation and DocumentTypePrivileges.DocumentDeletion.

Dear Grant,

I have to check each document type having creation and deletion permission for the particular User.please elaborate your code for my understanding.

If i use below code,value is coming empty.
DocumentTypePrivileges.DocumentCreation and DocumentTypePrivileges.DocumentDeletion.

Please explain step by step....
Much appreciated your help...

Daniel_Quill
Elite Collaborator
Elite Collaborator

You will need create the DocumentType object and use something similar to

if(docType.CanI(DocumentTypePrivileges.DocumentDeletion))
{
   ... DO WORK ...
}

This should return a Boolean value based on whether access is available.  You may need to consult your company's OnBase API certified co-workers for additional assistance or contact your first line of support.

Dear Daniel,

I have tested but the problem is it is only working on currently connected user.I want to know how to get the permission for other user i mean without connected user.
is there any way to get the privileges to other users using username