public void InstallObject(string mObject, string[] mOperations) { if (_App == null) { return; } objectRbac tempObject = ObjectSrv.GetByName(mObject, _App.AppID); if (tempObject != null) { return; } tempObject = new objectRbac(); tempObject.AppID = _App.AppID; tempObject.name = mObject; ObjectSrv.CreateNew(tempObject); foreach (string ope in mOperations) { operation TempOpe = OperationSrv.GetByName(ope, _App.AppID); if (TempOpe == null) { TempOpe = new operation(); TempOpe.name = ope; TempOpe.AppID = _App.AppID; OperationSrv.CreateNew(TempOpe); } permission TempPermission = new permission(); TempPermission.AppID = _App.AppID; TempPermission.name = tempObject.name + ":" + TempOpe.name; TempPermission.ObjectRBAC = tempObject; TempPermission.Operation = TempOpe; PermissionSrv.CreateNew(TempPermission); } PermissionSrv.CommitChanges(); }
public void AddOperation(operation mOperation) { mOperation.AppID = App.AppID; OperationSrv.CreateNew(mOperation); }