If the current member is not a "Manager" of any sites, they shouldn't be able to manage MultisitesAware DataObjects.
519410
public function updateEditForm($form){
		if($this->modelIsMultiSitesAware()) {
			$managedSites = Multisites::inst()->sitesManagedByMember();
			$source = Site::get()->filter('ID', Multisites::inst()->sitesManagedByMember())->map('ID', 'Title')->toArray();
			$plural = singleton($this->owner->modelClass)->plural_name();
			if(!count($source)){
				$form->setFields(FieldList::create(
					LiteralField::create('NotAManager', "You do not have permission to manage $plural on any Sites")
				));
			}
		}
	}
596732
function freezeOrganization(organization) {
    if (organization.propertyMap) {
        organization.propertyMap = Object.freeze(organization.propertyMap);
    }
    return domain.freeze(organization);
}
945793
protected void unsetEmbeddableWebSphereTransactionManager(ServiceReference<EmbeddableWebSphereTransactionManager> ref) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "unsetEmbeddableWebSphereTransactionManager", "unsetting " + ref);
        }
        embeddableWebSphereTransactionManagerRef.unsetReference(ref);
    }
197824
def handle_delete(self):
        """"""
        from intranet.apps.eighth.models import EighthScheduledActivity
        EighthScheduledActivity.objects.filter(eighthsignup_set__user=self).update(
            archived_member_count=F('archived_member_count')+1)
803829
protected void removeAdminObjectService(ServiceReference<AdminObjectService> reference, String id, boolean jndiName) {
        NamedAdminObjectServiceInfo aosInfo = adminObjectServices.get(id);
        if (aosInfo != null) {
            aosInfo.getServices(jndiName).removeReference(reference);

            // If the highest reference before updating is the one we just
            // removed, then we need to deactivate any endpoints using it.
            if (reference.equals(aosInfo.serviceRef)) {
                deactivateEndpoints(aosInfo.endpointFactories);

                // If there are no more references with this name, then clean
                // up the info object.  Otherwise, reactivate the endpoints
                // using the new admin object.
                if (aosInfo.updateServiceRef() == null) {
                    cleanupAdminObjectServiceInfo(aosInfo);
                } else {
                    activateDeferredEndpoints(aosInfo.endpointFactories);
                }
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "unset reference not the primary reference");
                }
            }
        }

        // With the removal of an adminObjectService, there is a possibility
        // that some lookups could now fail, and endpoints which rely on them
        // need to deactivate until it becomes available again.
        updateSchemeJndiNames(false);

    }
71738
private void removeMemberships(Node membershipTypeNode) throws Exception
   {
      PropertyIterator refTypes = membershipTypeNode.getReferences();
      while (refTypes.hasNext())
      {
         Property refTypeProp = refTypes.nextProperty();

         Node refTypeNode = refTypeProp.getParent();
         Node refUserNode = refTypeNode.getParent();

         membershipHandler.removeMembership(refUserNode, refTypeNode);
      }
   }
1314366
def remove_member(mem)
      raise InvalidDataError, "Smart group members can't be changed." if @is_smart
      raise InvalidDataError, "Can't remove nil" if mem.nil?
      removed = @members.reject! { |mm| [mm[:id], mm[:name], mm[:username]].include? mem }
      @need_to_update = true if removed
    end
657093
def updateMember(self, data, address, id, headers=None, query_params=None, content_type="application/json"):
        
        uri = self.client.base_url + "/network/"+id+"/member/"+address
        return self.client.post(uri, data, headers, query_params, content_type)
6320
function() {
    this.header = undefined;
    this.credentials = undefined;
    this.meta = undefined;
    this.xml = undefined;
    this.binaries = new KdbxBinaries();
    this.groups = [];
    this.deletedObjects = [];
    Object.preventExtensions(this);
}
723944
@Deprecated
    public void deleteProjectMembership(int membershipId) throws RedmineException {
        transport.deleteObject(Membership.class, Integer.toString(membershipId));
    }
1163624
public void synchronizeUserOrganizationMembership(DbSession dbSession, UserDto user, ALM alm, Set<String> organizationAlmIds) {
    Set<String> userOrganizationUuids = dbClient.organizationMemberDao().selectOrganizationUuidsByUser(dbSession, user.getId());
    Set<String> userOrganizationUuidsWithMembersSyncEnabled = dbClient.organizationAlmBindingDao().selectByOrganizationUuids(dbSession, userOrganizationUuids).stream()
      .filter(OrganizationAlmBindingDto::isMembersSyncEnable)
      .map(OrganizationAlmBindingDto::getOrganizationUuid)
      .collect(toSet());
    Set<String> almOrganizationUuidsWithMembersSyncEnabled = dbClient.organizationAlmBindingDao().selectByOrganizationAlmIds(dbSession, alm, organizationAlmIds).stream()
      .filter(OrganizationAlmBindingDto::isMembersSyncEnable)
      .map(OrganizationAlmBindingDto::getOrganizationUuid)
      .collect(toSet());

    Set<String> organizationUuidsToBeAdded = difference(almOrganizationUuidsWithMembersSyncEnabled, userOrganizationUuidsWithMembersSyncEnabled);
    Set<String> organizationUuidsToBeRemoved = difference(userOrganizationUuidsWithMembersSyncEnabled, almOrganizationUuidsWithMembersSyncEnabled);
    Map<String, OrganizationDto> allOrganizationsByUuid = dbClient.organizationDao().selectByUuids(dbSession, union(organizationUuidsToBeAdded, organizationUuidsToBeRemoved))
      .stream()
      .collect(uniqueIndex(OrganizationDto::getUuid));

    allOrganizationsByUuid.entrySet().stream()
      .filter(entry -> organizationUuidsToBeAdded.contains(entry.getKey()))
      .forEach(entry -> addMemberInDb(dbSession, entry.getValue(), user));
    allOrganizationsByUuid.entrySet().stream()
      .filter(entry -> organizationUuidsToBeRemoved.contains(entry.getKey()))
      .forEach(entry -> removeMemberInDb(dbSession, entry.getValue(), user));
  }
439556
private void failIfInCollection(Member c2jMemberDefinition, Shape parentShape) {
        if (isMapShape(parentShape) || isListShape(parentShape)) {
            throw new IllegalArgumentException(String.format(
                "Member (%s) has timestamp format provided. Timestamp format is not supported for Date in List/Map",
                c2jMemberDefinition.getShape()));
        }
    }
270013
void removeMembership(Node refUserNode, Node refTypeNode) throws Exception
   {
      refTypeNode.remove();
      if (!refUserNode.hasNodes())
      {
         refUserNode.remove();
      }
   }
910758
private void ensureLastAdminIsNotRemoved(DbSession dbSession, GroupDto group, UserDto user) {
    int remainingAdmins = dbClient.authorizationDao().countUsersWithGlobalPermissionExcludingGroupMember(dbSession,
      group.getOrganizationUuid(), OrganizationPermission.ADMINISTER.getKey(), group.getId(), user.getId());
    checkRequest(remainingAdmins > 0, "The last administrator user cannot be removed");
  }
776880
private void removeMemberships(Node userNode, boolean broadcast) throws RepositoryException
   {
      PropertyIterator refUserProps = userNode.getReferences();
      while (refUserProps.hasNext())
      {
         Node refUserNode = refUserProps.nextProperty().getParent();
         refUserNode.remove();
      }
   }
1309411
public ServerUpdater removeRolesFromUser(User user, Collection<Role> roles) {
        delegate.removeRolesFromUser(user, roles);
        return this;
    }
486039
public Membership remove(Collection<Address> v) {
        if(v != null) {
            synchronized(members) {
                members.removeAll(v);
            }
        }
        return this;
    }