Java Code Examples for org.keycloak.models.GroupModel#getId()

The following examples show how to use org.keycloak.models.GroupModel#getId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CachedGroup.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public CachedGroup(Long revision, RealmModel realm, GroupModel group) {
    super(revision, group.getId());
    this.realm = realm.getId();
    this.name = group.getName();
    this.parentId = group.getParentId();
    this.attributes = new DefaultLazyLoader<>(source -> new MultivaluedHashMap<>(source.getAttributes()), MultivaluedHashMap::new);
    this.roleMappings = new DefaultLazyLoader<>(source -> source.getRoleMappings().stream().map(RoleModel::getId).collect(Collectors.toSet()), Collections::emptySet);
    this.subGroups = new DefaultLazyLoader<>(source -> source.getSubGroups().stream().map(GroupModel::getId).collect(Collectors.toSet()), Collections::emptySet);
}
 
Example 2
Source File: GroupMovedEvent.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public static GroupMovedEvent create(GroupModel group, GroupModel toParent, String realmId) {
    GroupMovedEvent event = new GroupMovedEvent();
    event.realmId = realmId;
    event.groupId = group.getId();
    event.oldParentId = group.getParentId();
    event.newParentId = toParent==null ? null : toParent.getId();
    return event;
}
 
Example 3
Source File: GroupRemovedEvent.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public static GroupRemovedEvent create(GroupModel group, String realmId) {
    GroupRemovedEvent event = new GroupRemovedEvent();
    event.realmId = realmId;
    event.groupId = group.getId();
    event.parentId = group.getParentId();
    return event;
}
 
Example 4
Source File: GroupPermissions.java    From keycloak with Apache License 2.0 4 votes vote down vote up
private static String getGroupResourceName(GroupModel group) {
    return RESOURCE_NAME_PREFIX + group.getId();
}
 
Example 5
Source File: GroupPermissions.java    From keycloak with Apache License 2.0 4 votes vote down vote up
private static String getManagePermissionGroup(GroupModel group) {
    return "manage.permission.group." + group.getId();
}
 
Example 6
Source File: GroupPermissions.java    From keycloak with Apache License 2.0 4 votes vote down vote up
private static String getManageMembersPermissionGroup(GroupModel group) {
    return "manage.members.permission.group." + group.getId();
}
 
Example 7
Source File: GroupPermissions.java    From keycloak with Apache License 2.0 4 votes vote down vote up
private static String getManageMembershipPermissionGroup(GroupModel group) {
    return "manage.membership.permission.group." + group.getId();
}
 
Example 8
Source File: GroupPermissions.java    From keycloak with Apache License 2.0 4 votes vote down vote up
private static String getViewPermissionGroup(GroupModel group) {
    return "view.permission.group." + group.getId();
}
 
Example 9
Source File: GroupPermissions.java    From keycloak with Apache License 2.0 4 votes vote down vote up
private static String getViewMembersPermissionGroup(GroupModel group) {
    return "view.members.permission.group." + group.getId();
}