Class CreateGroupPermissionSyncer

  • All Implemented Interfaces:
    ChangeMergedListener

    public class CreateGroupPermissionSyncer
    extends Object
    implements ChangeMergedListener
    With groups in NoteDb, the capability of creating a group is expressed as a CREATE permission on refs/groups/* rather than a global capability in All-Projects.

    During the transition phase, we have to keep these permissions in sync with the global capabilities that serve as the source of truth.

    This class implements a one-way synchronization from the global CREATE_GROUP capability in All-Projects to a CREATE permission on refs/groups/* in All-Users.

    • Method Detail

      • syncIfNeeded

        public void syncIfNeeded()
                          throws IOException,
                                 org.eclipse.jgit.errors.ConfigInvalidException
        Checks if GlobalCapability.CREATE_GROUP and CREATE permission on refs/groups/* have diverged and syncs them by applying the CREATE permission to refs/groups/*.
        Throws:
        IOException
        org.eclipse.jgit.errors.ConfigInvalidException