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

115/If current user has role user show only vms associated to user #247

Merged
merged 7 commits into from
Jan 11, 2019

Conversation

mlichtblau
Copy link
Contributor

Fixes #115

@mlichtblau mlichtblau changed the title If current user has role user show only vms associated to user 115/If current user has role user show only vms associated to user Jan 11, 2019
@@ -31,7 +35,8 @@ def new

def show
@vm = VmApi.instance.get_vm_info(params[:id])
render(template: 'errors/not_found', status: :not_found) if @vm.nil?
return render(template: 'errors/not_found', status: :not_found) if @vm.nil?
return redirect_to vms_path unless !current_user.user? || current_user.vms.include?(@vm)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you refactor this to a before_action?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can also use this for edit...

Copy link
Contributor

@westphal-jan westphal-jan left a comment

Choose a reason for hiding this comment

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

See Lasses comment.

@mlichtblau mlichtblau merged commit 944a4dc into dev Jan 11, 2019
@arne-z arne-z deleted the 115/login/vm-access branch February 7, 2019 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants