Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set maximum device problem #215

Closed
rhenku opened this issue Jul 14, 2015 · 18 comments
Closed

Set maximum device problem #215

rhenku opened this issue Jul 14, 2015 · 18 comments

Comments

@rhenku
Copy link

rhenku commented Jul 14, 2015

i have small problem, if i set user as manager and set maximum device it work, but if user as manager add user and set maximum devices he can set any number maximum devices.. :D so he can add user and give max number he like..

sory my english bad.. :)

@vitalidze
Copy link
Owner

This is a known issue and a subject to change in scope of #214.

@wolfbgn
Copy link

wolfbgn commented Aug 15, 2015

I dont know if this is the place to mention this. Sorry if I am wrong.
At the moment USER is able to change maximum number of devices and expiration date.
It has to be USER with limited rights not to be able to change these values.
I dont know if I am right but I think that USERS should not be able to change those values.

@vitalidze
Copy link
Owner

Yeah, I know about this issue. It should be fixed in next version along with #214

@wolfbgn
Copy link

wolfbgn commented Aug 15, 2015

Thank you.

@draganjovanovich
Copy link
Contributor

i fixed that by adding this code in userDialog.java and disable ui:field "*****" in xml, i dont know is that correct solution,but it seems to work fine.,. if you want manager to have acces also , just add manager in if statement.

        if (ApplicationContext.getInstance().getUser().getAdmin()) {
            admin.setEnabled(true);
            manager.setEnabled(true);
            readOnly.setEnabled(true);
            expirationDate.setEnabled(true);
            maxNumOfDevices.setEnabled(true);
        }
        else {
            manager.setEnabled(false);
            admin.setEnabled(false);
            readOnly.setEnabled(false);
            expirationDate.setEnabled(false);
            maxNumOfDevices.setEnabled(false);
        } 

@vitalidze
Copy link
Owner

This fixes it only in UI. You must restrict it on the server side as well (i.e. in DataServiceImpl class).

@draganjovanovich
Copy link
Contributor

Cool, i will do that...

@vitalidze
Copy link
Owner

You can then submit a pull request to share your solution.

@draganjovanovich
Copy link
Contributor

Ok, tomorrow i will try to change, test it and build.

@vitalidze
Copy link
Owner

Sounds good. Thank you.

@draganjovanovich
Copy link
Contributor

How to push changes from intellij ?

@vitalidze
Copy link
Owner

There should be a 'Push changes' item somewhere in 'Git' context menu. You can try searching it in the global search (opened after hitting 'shift shift' (i.e. shift for two times)).

@draganjovanovich
Copy link
Contributor

There is a push ,but it wont push it comes with access denied error.

@vitalidze
Copy link
Owner

If you have cloned my repository then it won't allow you to push since you don't have access here.

The correct workflow is:

  1. fork my repository
  2. make a push there
  3. create a pull request, so I can merge changes from your repository to mine.

Maybe it looks too complex, but this is the modern way to share your changes on github. I believe it's worth to learn this practice. Anyway, as an option you can just send me changed files by email and I will take it to my repository.

@draganjovanovich
Copy link
Contributor

Now ?

@vitalidze
Copy link
Owner

It's perfect. Thank you. I will walk through your code and ask you questions directly in #252

vitalidze added a commit that referenced this issue Sep 8, 2015
@vitalidze
Copy link
Owner

@wolfbgn now user cannot change neither his expiration date not his maximum number of devices, is is included in 0.8.1rc2

vitalidze added a commit that referenced this issue Sep 29, 2015
vitalidze added a commit that referenced this issue Sep 30, 2015
…of devices setting for a user, added tests and corresponding UI message
@vitalidze
Copy link
Owner

Implemented, written news, updated latest and demo versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants