mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
[bug] users promoted to the administrator role are not in the admin group
This commit is contained in:
parent
8ea36b8a89
commit
37901e4153
@ -1,6 +1,7 @@
|
|||||||
# Changelog Fab-manager
|
# Changelog Fab-manager
|
||||||
|
|
||||||
- Fix a bug: the subscription page is not available
|
- Fix a bug: the subscription page is not available
|
||||||
|
- Fix a bug: users promoted to the administrator role are not in the admin group
|
||||||
|
|
||||||
## v4.4.0 2020 May 12
|
## v4.4.0 2020 May 12
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs',
|
|||||||
* Switch the user's view from the reservation agenda to the plan subscription
|
* Switch the user's view from the reservation agenda to the plan subscription
|
||||||
*/
|
*/
|
||||||
$scope.showPlans = function () {
|
$scope.showPlans = function () {
|
||||||
// first, we ensure that a user was selected (admin) or logged (member)
|
// first, we ensure that a user was selected (admin/manager) or logged (member)
|
||||||
const isSelectedUser = Object.keys($scope.user).length > 0;
|
const isSelectedUser = Object.keys($scope.user).length > 0;
|
||||||
// all slots are in future
|
// all slots are in future
|
||||||
const areFutureSlots = _.every($scope.events.reserved, function(s) {
|
const areFutureSlots = _.every($scope.events.reserved, function(s) {
|
||||||
|
@ -219,6 +219,9 @@ class API::MembersController < API::ApiController
|
|||||||
@member.remove_role ex_role
|
@member.remove_role ex_role
|
||||||
@member.add_role params[:role]
|
@member.add_role params[:role]
|
||||||
|
|
||||||
|
# if the new role is 'admin', then change the group to the admins group
|
||||||
|
@member.update_attributes(group_id: Group.find_by(slug: 'admins').id) if params[:role] == 'admin'
|
||||||
|
|
||||||
NotificationCenter.call type: 'notify_user_role_update',
|
NotificationCenter.call type: 'notify_user_role_update',
|
||||||
receiver: @member,
|
receiver: @member,
|
||||||
attached_object: @member
|
attached_object: @member
|
||||||
|
Loading…
x
Reference in New Issue
Block a user