# Define users and groups in app creation

**URL:** https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313
**Category:** Flowable Application
**Created:** [February 17, 2017, 7:40pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313 "2017-02-17T19:40:53Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Sibok666](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sibok666/32/292_2.png) [@Sibok666](https://forum.flowable.org/u/Sibok666)
#### Post date: [February 17, 2017, 7:40pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/1 "2017-02-17T19:40:53Z")

</div>

From the UI Modeler-App I will implement some fields that are going to indicate wich users and groups can acces the app created.

Any suggestion on how to start to add the fields in the angular-app?

I hope some body can help.

Best Regards

---

<div class="post-metadata">

### Author: ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)
#### Post date: [February 20, 2017, 9:41am UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/2 "2017-02-20T09:41:42Z")

</div>

Hi,

The Modeler app is a regular Angular 1.x app, so not a lot of suggestions I guess.  
The views/app-definition-builder.html file and scripts/controllers/app-definition-builder.js file are important for the fields you want to add.

Best regards,

Tijs

---

<div class="post-metadata">

### Author: ![Sibok666](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sibok666/32/292_2.png) [@Sibok666](https://forum.flowable.org/u/Sibok666)
#### Post date: [February 22, 2017, 10:25pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/3 "2017-02-22T22:25:43Z")

</div>

Hi @tijs,

I was working on the feature to restrict who can access the app, but im a little lost, until today there are the steps i have followed:

I started to modify the modeler-app.  
I have added the next fields to the view app-definition-builder.html :

```
            <div class="col-xs-8">
				<div class="form-group">
					<label for="groupAccessApp">{{'APP.GROUPS-ACCESS' | translate}}</label>
						<input ng-disabled="model.loading" type="text" class="form-control"
						               id="groupAccessApp" ng-model="model.app.groupsAccess"
			                         custom-keys enter-pressed="ok()" >
				</div>
			</div>
			<div class="col-xs-8">
				<div class="form-group">
					<label for="userAccessApp">{{'APP.USERS-ACCESS' | translate}}</label>
						<input ng-disabled="model.loading" type="text" class="form-control"
						               id="userAccessApp" ng-model="model.app.usersAccess"
			                         custom-keys enter-pressed="ok()" >
				</div>
			</div>    

```

Now the ui looks like this:  
 ![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/b45e08634c17ce055163cc0ed7ecf777252c03df.png)

Now I want to store the user input in the field groupsAccess and usersAccess, but I really dont know how to do that.

I have added the fields in the next classes:

in app definition.js  
 ![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/cbbe8ee2031e7b63bf35b3e009099c0b4db23f78.png)

In app-definition-Builder.java:  
 ![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/67a8552f1222496f0112b4f973cdb20331a29648.png)

inm app model definition:

![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/1cbaa9044e51c65b00e197f58eb5daf1d8c6c586.png)

In modelsResource.java in the method createModel():  
 ![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/82deadcefc2c350b0a33896d079546f89a811f2f.png)

An the model persists correctly, but with null values, I cant get the values that I writte in the UI.

Any suggestions?

Thanks.

---

<div class="post-metadata">

### Author: ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)
#### Post date: [February 23, 2017, 8:40am UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/4 "2017-02-23T08:40:17Z")

</div>

Hi,

I would expect that the ng-model for these additional properties would be:

currentAppDefinition.definition.groupsAccess and currentAppDefinition.definition.usersAccess

currentAppDefinition is the object that is used in app-definition-toolbar-default-actions.js to save the app definition. I also see that you are copying the usersAccess and groupsAccess from the selected model in the process model popup. But that’s not correct I think. You want to fill-in the users and groups directly from the app definition builder and not copy them from the process model.

Best regards,

Tijs

---

<div class="post-metadata">

### Author: ![Sibok666](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sibok666/32/292_2.png) [@Sibok666](https://forum.flowable.org/u/Sibok666)
#### Post date: [February 23, 2017, 9:33pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/5 "2017-02-23T21:33:10Z")

</div>

Hi, @tijs I already made the changes that you suggested and I have to say the persistence layer works like magic, I only added the current var definitions in the app-definition-toolbar-default-actions.js and the current strings in the class AppDefinition.java and I did a click on the button and my data was persisted.

Can you please explain how this persistence works?

Im really glad with the knowledgement that im acquiring, doing some small modifications.

Now Im going to the task app, for getting and restric the acces to the apps, later I will tell you what happen with this change.

Best regards.

---

<div class="post-metadata">

### Author: ![Sibok666](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sibok666/32/292_2.png) [@Sibok666](https://forum.flowable.org/u/Sibok666)
#### Post date: [February 27, 2017, 10:56pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/6 "2017-02-27T22:56:35Z")

</div>

Hi @tijs I Need your help, now im working on the task-app for getting the list of tasks, I want to get the app definition for get the values of usersAccess and groups access, so I have set the attrib in the next classes:

AppDefinitionRepresentation.Java, AppModel.Java

But always get the values in null

![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/fd1575a101546e72ad470516ffd55341a7d6251c.png)

The values of groupsAcces and usersAccess are persisted correctly in the field model\_editor\_json field of the table flowable.act\_de\_model, how can i get thesse values?

Any idea of what Im doing wrong?

Thanks.

Best regards.

---

<div class="post-metadata">

### Author: ![tijs](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@tijs](https://forum.flowable.org/u/tijs)
#### Post date: [February 28, 2017, 7:53am UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/7 "2017-02-28T07:53:37Z")

</div>

Hi,

Do you have a Github repo where I can have a look at all your changes and the full source code?

Best regards,

Tijs

---

<div class="post-metadata">

### Author: ![Sibok666](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sibok666/32/292_2.png) [@Sibok666](https://forum.flowable.org/u/Sibok666)
#### Post date: [February 28, 2017, 10:59pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/8 "2017-02-28T22:59:56Z")

</div>

Yes, tijs here is the repo

> **[sibok666/flowable-engine](https://github.com/sibok666/flowable-engine)**
>
> A compact and highly efficient workflow and Business Process Management (BPM) platform for developers, system admins and business users. - sibok666/flowable-engine

Today I created a fork of the project and upload the changes that I ve made, but I think a lot of changes that you have done get lost in my repo.

Maybe you can help me I Im triying to run the project from this repository but I cant add the uii app like web modules, but the only web module that i see is the flowable-engine module, do you know anything about this beahavior?

Thanks.

Best regards

---

<div class="post-metadata">

### Author: ![Sibok666](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sibok666/32/292_2.png) [@Sibok666](https://forum.flowable.org/u/Sibok666)
#### Post date: [February 28, 2017, 11:41pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/9 "2017-02-28T23:41:00Z")

</div>

Well I just have to right click and go to config–\>detect and update nested projects, for make each nested project a maven project, im sorry for my dummyness, maybe this helps someone

---

<div class="post-metadata">

### Author: ![belarmino.silva](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@belarmino.silva](https://forum.flowable.org/u/belarmino.silva)
#### Post date: [March 9, 2017, 1:06pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/10 "2017-03-09T13:06:25Z")

</div>

I do similar feature ([https://github.com/Belarmino/bfl](https://github.com/Belarmino/bfl)) but for multiple user and group my problem now is in task to get this users and groups, i have change files in my second commit(Task Changes) but i get an error e call getModelEditorJson e appModel variable. ![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/flowable/original/1X/9698bda09cf7adbbff0195ef3074a0b41e96b0c7.png)

---

<div class="post-metadata">

### Author: ![Sibok666](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/sibok666/32/292_2.png) [@Sibok666](https://forum.flowable.org/u/Sibok666)
#### Post date: [March 22, 2017, 5:09pm UTC](https://forum.flowable.org/t/define-users-and-groups-in-app-creation/313/11 "2017-03-22T17:09:49Z")

</div>

Hi there @belarmino.silva excuseme, I just forgott to tell you that tijs help me, to refactoring the code and now this feature is included in the master repo of flowable.

I hope this will be usseful for you.

Best regards
