-
Notifications
You must be signed in to change notification settings - Fork 15
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
Issue #87 Do not display content if a user does not have permission #93
Issue #87 Do not display content if a user does not have permission #93
Conversation
e2ebf0b
to
9cd924e
Compare
$blockcontext = context_block::instance($this->instance->id); | ||
if (!has_capability('block/massaction:use', $blockcontext)) { | ||
$this->content->text = get_string('nopermissions', 'error', get_string('massaction:use', 'block_massaction')); | ||
return $this->content; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why we need to display anything at all? IMHO we don't need to display content at all if user don't have permissions. But let's leave it up to the maintainer to decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user adds the block without use permission, I think we need to show something for the block.
It's probably better not to allow to add the block if user doesn't have use permission.
I'm leaving this as I updated.
Please let me know which solution is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block can be already in a course when a user with caps to see the block, but without caps to do anything with mass actions accessing a course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best method is to show the "No permission" message. I could see it being confusing if a user added the block but didn't see the block. They would probably think that the block wasn't added correctly. For as rare as this case would probably be I think I can live with it.
9cd924e
to
3ac512a
Compare
Rebased with the latest |
3ac512a
to
7e126bb
Compare
Show permission error if the user doesn't have permission.