public static DbSetPermit GetDbSetPermissions(DbSetInfo dbInfo, IAuthorizer authorizer) { MethodInfo methInfo = null; DbSetPermit permit = new DbSetPermit(); methInfo = dbInfo.getOperationMethodInfo(OperationNames.CREATE); permit.canAddRow = methInfo != null && CanAccessMethod(methInfo,authorizer); methInfo = dbInfo.getOperationMethodInfo(OperationNames.UPDATE); permit.canEditRow = methInfo != null && CanAccessMethod(methInfo, authorizer); methInfo = dbInfo.getOperationMethodInfo(OperationNames.DELETE); permit.canDeleteRow = methInfo != null && CanAccessMethod(methInfo, authorizer); methInfo = dbInfo.getOperationMethodInfo(OperationNames.REFRESH); permit.canRefreshRow = methInfo != null && CanAccessMethod(methInfo, authorizer); return permit; }
public static DbSetPermit GetDbSetPermissions(DbSetInfo dbInfo, IAuthorizer authorizer) { MethodInfo methInfo = null; DbSetPermit permit = new DbSetPermit(); methInfo = dbInfo.getOperationMethodInfo(OperationNames.CREATE); permit.canAddRow = methInfo != null && CanAccessMethod(methInfo, authorizer); methInfo = dbInfo.getOperationMethodInfo(OperationNames.UPDATE); permit.canEditRow = methInfo != null && CanAccessMethod(methInfo, authorizer); methInfo = dbInfo.getOperationMethodInfo(OperationNames.DELETE); permit.canDeleteRow = methInfo != null && CanAccessMethod(methInfo, authorizer); methInfo = dbInfo.getOperationMethodInfo(OperationNames.REFRESH); permit.canRefreshRow = methInfo != null && CanAccessMethod(methInfo, authorizer); return(permit); }
public static MethodInfo GetCRUDMethodInfo(DbSetInfo dbInfo, RowInfo rowInfo) { MethodInfo methInfo = null; switch (rowInfo.changeType) { case ChangeType.Added: methInfo = dbInfo.getOperationMethodInfo(OperationNames.CREATE); break; case ChangeType.Deleted: methInfo = dbInfo.getOperationMethodInfo(OperationNames.DELETE); break; case ChangeType.Updated: methInfo = dbInfo.getOperationMethodInfo(OperationNames.UPDATE); break; default: throw new DomainServiceException(string.Format(ErrorStrings.ERR_REC_CHANGETYPE_INVALID, dbInfo.EntityType.Name, rowInfo.changeType)); } return methInfo; }
public static MethodInfo GetCRUDMethodInfo(DbSetInfo dbInfo, RowInfo rowInfo) { MethodInfo methInfo = null; switch (rowInfo.changeType) { case ChangeType.Added: methInfo = dbInfo.getOperationMethodInfo(OperationNames.CREATE); break; case ChangeType.Deleted: methInfo = dbInfo.getOperationMethodInfo(OperationNames.DELETE); break; case ChangeType.Updated: methInfo = dbInfo.getOperationMethodInfo(OperationNames.UPDATE); break; default: throw new DomainServiceException(string.Format(ErrorStrings.ERR_REC_CHANGETYPE_INVALID, dbInfo.EntityType.Name, rowInfo.changeType)); } return(methInfo); }