Define users and groups in app creation

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

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

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:

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

In app-definition-Builder.java:

inm app model definition:

In modelsResource.java in the method createModel():

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

Any suggestions?

Thanks.

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

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.

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

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.

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

Yes, tijs here is the repo

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

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

I do similar feature (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.

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