Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/app/tabs/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ <h3 class="card-header">{{'sync' | i18n}}</h3>
<small class="text-muted form-text" *ngIf="directory === directoryType.GSuite">{{'ex' | i18n}}
include:Sales,IT</small>
</div>
<label for="groupPrefix" [hidden]="directory != directoryType.AzureActiveDirectory">{{'groupPrefix' | i18n}}</label>
<input type="text" class="form-control" id="groupPrefix" name="GroupPrefix"
[(ngModel)]="sync.groupPrefix" [hidden]="directory != directoryType.AzureActiveDirectory">
<div class="form-group" [hidden]="directory != directoryType.Ldap">
<label for="groupPath">{{'groupPath' | i18n}}</label>
<input type="text" class="form-control" id="groupPath" name="GroupPath"
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@
"groupFilter": {
"message": "Group Filter"
},
"groupPrefix": {
"message": "Remove group prefix"
},
"syncGroupsOneLogin": {
"message": "Sync roles"
},
Expand Down
1 change: 1 addition & 0 deletions src/models/syncConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export class SyncConfiguration {
users = false;
groups = false;
groupPrefix: string;
interval = 5;
userFilter: string;
groupFilter: string;
Expand Down
4 changes: 3 additions & 1 deletion src/services/azure-directory.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire
const entry = new GroupEntry();
entry.referenceId = group.id;
entry.externalId = group.id;
entry.name = group.displayName;
entry.name = this.syncConfig.groupPrefix != null ?
group.displayName.replace(new RegExp(`^${this.syncConfig.groupPrefix}`), '') :
group.displayName;

const memReq = this.client.api('/groups/' + group.id + '/members');
let memRes = await memReq.get();
Expand Down