Beispiel #1
0
 private void SetEntitySchemaRecordRightLevel(Guid adminUnitId, string schemaName, Guid administratedRecordId,
                                              EntitySchemaRecordRightLevel rightLevel, bool useDenyRecordRights)
 {
     foreach (EntitySchemaRecordRightOperation operation in Enum.GetValues(typeof(EntitySchemaRecordRightOperation)))
     {
         DBSecurityEngine.SetEntitySchemaRecordRightLevel(adminUnitId, schemaName, administratedRecordId, operation, rightLevel, useDenyRecordRights);
     }
 }
Beispiel #2
0
        private void SetSubscriberDefaultRights(SocialSubscription socialSubscription)
        {
            var sysAdminUnitId = socialSubscription.SysAdminUnitId;

            if (sysAdminUnitId.Equals(UserConnection.CurrentUser.Id))
            {
                return;
            }
            var socialSubscriptionId = socialSubscription.Id;
            var schema = UserConnection.EntitySchemaManager.GetInstanceByName("SocialSubscription");

            if (!schema.AdministratedByRecords)
            {
                return;
            }
            DBSecurityEngine.SetEntitySchemaRecordRightLevel(sysAdminUnitId, schema.Name, socialSubscriptionId,
                                                             EntitySchemaRecordRightOperation.Read, EntitySchemaRecordRightLevel.AllowAndGrant, schema.UseDenyRecordRights);
            DBSecurityEngine.SetEntitySchemaRecordRightLevel(sysAdminUnitId, schema.Name, socialSubscriptionId,
                                                             EntitySchemaRecordRightOperation.Delete, EntitySchemaRecordRightLevel.AllowAndGrant, schema.UseDenyRecordRights);
        }