PublicAPI.Docflow.Document.AddViewPermission ELMA API Documentation
Grant the user permissions to view the document
 
 
Syntax

public void AddViewPermission(
	Document document,
	User user
)

Parameters

document
Type: Document
Document, whose permission needs to be granted. Object. Access path: PublicAPI.Docflow.Document
user
Type: User
User, to grant permissions to. Object. Access path: PublicAPI.Portal.Security.User
Remarks

The knowledge base article on this subject
Examples

//load the document by ID 
var doc = PublicAPI.Docflow.Document.Load(3);
//load the user by ID 
var user = PublicAPI.Portal.Security.User.Load(3);

//add the permissions
PublicAPI.Docflow.Document.AddViewPermission(doc, user);

//WARNING!! If the user already has these permissions, the function will not add anything
See Also