本文整理汇总了C#中ObjectClass.NeedsRightsTable方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectClass.NeedsRightsTable方法的具体用法?C# ObjectClass.NeedsRightsTable怎么用?C# ObjectClass.NeedsRightsTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectClass
的用法示例。
在下文中一共展示了ObjectClass.NeedsRightsTable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoDeleteObjectClass
public void DoDeleteObjectClass(ObjectClass objClass)
{
if (objClass.NeedsRightsTable())
{
DoDeleteObjectClassSecurityRules(objClass);
}
var tbl = db.GetTableName(objClass.Module.SchemaName, objClass.TableName);
Log.InfoFormat("Drop Table: {0}", tbl);
if (db.CheckTableExists(tbl))
db.DropTable(tbl);
}
示例2: CheckTableSecurityRules
private void CheckTableSecurityRules(ObjectClass objClass)
{
if (objClass.NeedsRightsTable())
{
var tblName = objClass.GetTableRef(db);
var tblRightsName = db.GetTableName(objClass.Module.SchemaName, Construct.SecurityRulesTableName(objClass));
var rightsViewUnmaterializedName = db.GetTableName(objClass.Module.SchemaName, Construct.SecurityRulesRightsViewUnmaterializedName(objClass));
var refreshRightsOnProcedureName = db.GetProcedureName(objClass.Module.SchemaName, Construct.SecurityRulesRefreshRightsOnProcedureName(objClass));
if (!db.CheckTableExists(tblRightsName))
{
Log.WarnFormat("Security Rules Table '{0}' is missing", tblRightsName);
if (repair)
{
Case.DoNewObjectClassACL(objClass);
}
}
else
{
if (!db.CheckViewExists(rightsViewUnmaterializedName))
{
Log.WarnFormat("Security Rules unmaterialized View '{0}' is missing", rightsViewUnmaterializedName);
if (repair)
{
Case.DoCreateRightsViewUnmaterialized(objClass);
}
}
if (!db.CheckProcedureExists(refreshRightsOnProcedureName))
{
Log.WarnFormat("Security Rules Refresh Procedure '{0}' is missing", refreshRightsOnProcedureName);
if (repair)
{
db.CreateRefreshRightsOnProcedure(refreshRightsOnProcedureName, rightsViewUnmaterializedName, tblName, tblRightsName);
}
}
}
}
}
示例3: IsNewObjectClassACL
public bool IsNewObjectClassACL(ObjectClass objClass)
{
if (!objClass.NeedsRightsTable()) return false;
ObjectClass savedObjClass = savedSchema.FindPersistenceObject<ObjectClass>(objClass.ExportGuid);
return savedObjClass == null || !savedObjClass.NeedsRightsTable();
}
示例4: IsDeleteObjectClassSecurityRules
public bool IsDeleteObjectClassSecurityRules(ObjectClass objClass)
{
if (objClass.NeedsRightsTable()) return false;
ObjectClass savedObjClass = savedSchema.FindPersistenceObject<ObjectClass>(objClass.ExportGuid);
return savedObjClass != null && savedObjClass.NeedsRightsTable();
}
示例5: IsChangeObjectClassACL
public bool IsChangeObjectClassACL(ObjectClass objClass)
{
if (objClass == null) throw new ArgumentNullException("objClass");
// Basic checks
if (!objClass.NeedsRightsTable()) return false;
ObjectClass savedObjClass = savedSchema.FindPersistenceObject<ObjectClass>(objClass.ExportGuid);
if (savedObjClass == null) return false;
if (!savedObjClass.NeedsRightsTable()) return false;
// Check each AccessControl
var acl = objClass.AccessControlList;
var savedAcl = savedObjClass.AccessControlList;
if (acl.Count != savedAcl.Count) return true;
foreach (var ac in acl.OfType<RoleMembership>())
{
var sac = savedAcl.OfType<RoleMembership>().FirstOrDefault(i => i.ExportGuid == ac.ExportGuid);
if (sac == null) return true;
if (ac.Relations.Count != sac.Relations.Count) return true;
for (int i = 0; i < ac.Relations.Count; i++)
{
if (ac.Relations[i].ExportGuid != sac.Relations[i].ExportGuid) return true;
}
}
return false;
}
示例6: IsRenameObjectClassACL
public bool IsRenameObjectClassACL(ObjectClass objClass)
{
if (!objClass.NeedsRightsTable()) return false;
ObjectClass savedObjClass = savedSchema.FindPersistenceObject<ObjectClass>(objClass.ExportGuid);
if (savedObjClass == null || !savedObjClass.NeedsRightsTable()) return false;
return objClass.TableName != savedObjClass.TableName || objClass.Module.SchemaName != savedObjClass.Module.SchemaName;
}
示例7: DoDeleteObjectClass
public void DoDeleteObjectClass(ObjectClass savedObjClass)
{
if (!PreMigration(ClassMigrationEventType.Delete, savedObjClass, null))
return;
if (savedObjClass.NeedsRightsTable())
{
DoDeleteObjectClassSecurityRules(savedObjClass);
}
foreach (var lstPop in savedObjClass.Properties.OfType<ValueTypeProperty>().Where(p => p.IsList))
{
DoDeleteValueTypePropertyList(savedObjClass, lstPop, string.Empty);
}
foreach (var lstPop in savedObjClass.Properties.OfType<CompoundObjectProperty>().Where(p => p.IsList))
{
DoDeleteCompoundObjectPropertyList(savedObjClass, lstPop, string.Empty);
}
var mapping = savedObjClass.GetTableMapping();
if (mapping == TableMapping.TPT)
{
var tbl = savedObjClass.GetTableRef(db);
Log.InfoFormat("Drop Table: {0}", tbl);
if (db.CheckTableExists(tbl))
db.DropTable(tbl);
}
else if (mapping == TableMapping.TPH)
{
// TODO: Do delete all columns
}
else
{
throw new NotSupportedException(string.Format("Mapping {0} is not supported", mapping));
}
PostMigration(ClassMigrationEventType.Delete, savedObjClass, null);
}