Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

set admin user from a rake task and disable first-user is admin #314

Merged
merged 1 commit into from
Sep 8, 2015
Merged

set admin user from a rake task and disable first-user is admin #314

merged 1 commit into from
Sep 8, 2015

Conversation

jordimassaguerpla
Copy link
Member

fixes #313

@jordimassaguerpla
Copy link
Member Author

I've set false as default because it is the safest option, but it breaks backward compatibility ... is it ok?

@@ -39,3 +39,14 @@ ldap:
guess_email:
enabled: false
attr: ""

# Set first_user_admin to true if you want that the first user that signs up
# becomes the admin.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set first_user_admin to true if you want that the first user that signs up to be an admin.

@flavio
Copy link
Member

flavio commented Sep 8, 2015

yeah, I'm a bit sceptical about breaking the compatibility. I wouldn't do it

@mssola
Copy link
Collaborator

mssola commented Sep 8, 2015

Same here, default to true. Moreover, the config file is wrong, you should follow the current convention. It should be like this:

# Set to true if you want that the first user that signs up to be an admin. If
# this is false, then you will need to perform the following command to set the admin user:
#  $ rake portus:set_admin
first_user_admin:
  enabled: true

Then, when checking about this in the Ruby code, you write:

APP_CONFIG["first_user_admin"].enabled?

In fact, you can do this check inside the .slim file, there's no need to declare the @first_user_admin variable in the controller in my opinion.

@mssola
Copy link
Collaborator

mssola commented Sep 8, 2015

Oh, and by the way, could you update the Changelog ?

@jordimassaguerpla
Copy link
Member Author

does it look good now :)

# rake portus:set_admin
# in order to set the admin user
#

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line not needed

@mssola
Copy link
Collaborator

mssola commented Sep 8, 2015

LGTM 👏 Just fix my nitpicks and put everything into one commit ;)

@flavio
Copy link
Member

flavio commented Sep 8, 2015

+1

jordimassaguerpla added a commit that referenced this pull request Sep 8, 2015
set admin user from a rake task and disable first-user is admin
@jordimassaguerpla jordimassaguerpla merged commit e2a6f3d into SUSE:master Sep 8, 2015
@jordimassaguerpla jordimassaguerpla deleted the set_admin_task branch September 8, 2015 15:21
fixes #313

Signed-off-by: Jordi Massaguer Pla <jmassaguerpla@suse.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set admin user from a rake task and disable first-user is admin
3 participants