EntityExtensions.Assert Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

Assert(IEntity, Permission, User)

Throws a ForbiddenException if a user does not have the requested permission to an entity.

public static void Assert(this IEntity entity, Permission requested, User user = null)

Parameters

entity
IEntity

The entity to check.

requested
Permission

The requested permission.

user
User

The User to check permission for, null checks permission for the current User.