Пример #1
0
 private static Permission generatePermisson( ModelContext context, string name, bool state ) {
     try {
         Permission permission = new Permission() {
             Name = name,
             Credential = generateCredantial( context, state ),
             Task = generateTask( name )
         };
         context.PermissionSet.AddOrUpdate( p => p.Name, permission );
         Log.DebugFormat( $"generatePermisson: {permission.toString()}\nDONE" );
         return permission;
     } catch ( Exception e ) {
         Log.Error( "generatePermisson", e );
         return null;
     }
 }