Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37673

Re: Problem with capability

$
0
0
by Rex Lorenzo.  

Short answer: It is most likely because you didn't bump up the version number in your version.php file. Once you do that Moodle will ask you to update your block and it will add any new capabilities.

Longer answer: You are thinking of capabilities in the wrong way. Capabilities aren't a way of identifying a user's role. If you want to get a user's role, you can use get_user_roles(), which is found in lib/access.php.

A capability is more like "block/myblock:manage" meaning they have ability to edit a block's contents. Also, usually we use the capability "moodle/course:manageactivities" to give teachers access to stuff that students shouldn't be able to do.


Viewing all articles
Browse latest Browse all 37673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>