0
alexnaldo created
Guys,
I need fro create dynamic permissions from database, but the below code doesn't work.
public class AppAuthorizationProvider : AuthorizationProvider
{
IRepository<MyTable> _repository;
public AppAuthorizationProvider(IRepository<MyTable> repository)
{
_repository = repository;
}
public override void SetPermissions(IPermissionDefinitionContext context)
{
var items = _repository.GetAll().ToList();
..
..
}
}
How to make dependence valid from AppAuthorizationProvider ?
Thanks, Alexnaldo Santos
1 Answer(s)
-
0
Hi,
What error are you getting? You should normally inject and use repository inside your AppAuthorizationProvider.