Ejemplo n.º 1
0
        // // [PolicyPermission(System.Security.Permissions.SecurityAction.Demand, PolicyId = PermissionPolicyIdentifiers.AlterIdentity)]
        internal static void Delete(GenericApplicationParms parms)
        {
            if (parms.ApplictionId == null)
            {
                throw new InvalidOperationException("Must specify an application id");
            }

            foreach (var un in parms.ApplictionId)
            {
                var user = m_client.GetApplications(o => o.Name == un).CollectionItem.FirstOrDefault() as SecurityApplicationInfo;
                if (user == null)
                {
                    throw new KeyNotFoundException($"Application {un} not found");
                }

                m_client.DeleteApplication(user.Entity.Key.Value);
            }
        }