Skip to main content
5 votes
Accepted

Protecting public assets

This answer is a bit self-serving, but I'm the author of the Digital Download plugin. It allows you to control how and when assets are downloaded. You can restrict downloads by a time period, maximum ...
Lindsey D's user avatar
  • 24k
4 votes
Accepted

Restrict Permissions Per Entry Rather Than Per Section

There is a way - it's actually quite easy but you need to dig deep into Craft 3 to do it. In general: there is only one single Javascript function that fetches all elements for all index pages ...
Robin Schambach's user avatar
4 votes

Any reason why {% requirePermission 'editEntries:1' %} would stop working within the past week or so?

Assuming you've recently updated to Craft 3.1, if you look in your userpermissions table you'll see that they're now lowercase and using UIDs rather than integer IDs, like this: editentries:3bb69b06-...
Mike Pepper's user avatar
  • 4,391
4 votes
Accepted

Restrict viewing front end to specific group permissions

If you setup a User Group with the same handle as the Site you want them to have access to, this could be fairly easy. Let's say you have a site called "Acme" setup in the Sites settings. ...
Alex Roper's user avatar
  • 2,642
4 votes
Accepted

Folder Permissions denied with Nitro

This could be because you are setting your Settings → Assets → your volume File System Path to an absolute location outside the VM. Create an alias (or hard-set webroot) using: 'aliases' => [ '...
Oli's user avatar
  • 7,495
3 votes

Restrict Permissions Per Entry Rather Than Per Section

I had a similar problem where I needed to manage national and regional users groups where regional users should only see their own content. I didn’t like the idea of overriding the whole ...
lemp's user avatar
  • 41
3 votes

User permissions on a per-entry basis?

This might be considered more of a "workaround" than a technical solution, but I think it could actually solve your problem quite nicely... You can use CP CSS and/or CP JS to show or hide certain ...
Lindsey D's user avatar
  • 24k
3 votes
Accepted

Uploaded Assets always get 600 File Permission and are therefore not displayed (403 Error)

I just missed the "Assets in this volume have public URLs" lightswitch while setting up the volume :)
Rattikarl's user avatar
  • 393
3 votes

Permission for "Send an activation email now?" Option

This feature was added in Craft 3.3.5, see the changelog. If you update to this version, your users should be able to control whether the activation email is sent.
Jeremy Gimbel's user avatar
3 votes
Accepted

Is it possible to silo Users and their Content absolutely by site?

Neither assets nor users support multi-site. Their content does (i.e. custom fields for assets and/or users can be "translatable"), but all assets and users will always propagate to all the ...
Mats Mikkel Rummelhoff's user avatar
2 votes
Accepted

What SQL query can I run to remove all users assigned to a particular group?

You've done it the correct way. Assuming all of Craft's foreign keys and cascading deletes are all still in place, removing the user's element ID from the craft_elements table is the way to go and ...
Brad Bell's user avatar
  • 67.5k
2 votes
Accepted

Users allocating permissions beyond their own

You should consider voting for this feature request: https://github.com/craftcms/cms/issues/915
Brad Bell's user avatar
  • 67.5k
2 votes
Accepted

Override permissions for Craft Commerce saveProduct controller

You'll have to write a custom plugin and point your frontend form to save to its own controller action that allows anonymous access. That action can either 1) duplicate Commerce's saveProduct method, ...
Brad Bell's user avatar
  • 67.5k
2 votes
Accepted

How can I separate assign user groups and permissions for users?

Non-admin users cannot change permissions for Admin users. However, I agree with what you've said on users being able to assign groups and permissions. On practically every site I build, I need the ...
darylknight's user avatar
  • 3,290
2 votes
Accepted

What do some Craft permissions mean?

Access the site when the system is off means that a logged in user with that permission can view the website front end (I think - never actually used this). You can set the system status in Settings > ...
Matt Wilcox's user avatar
  • 3,209
2 votes
Accepted

Entry publishing workflow

With a mixture of the permissions you mention above and user groups, you should be able to use the Workflow plugin to get the results you are looking for.
Stephen Hamilton's user avatar
2 votes

Allow a User Group to access plugin pages (without hasCpSection)

Register new user permissions to restrict access to those pages using the registerUserPermissions hook. Then use registerCpRoutes to setup routes to a controller action which checks for required user ...
carlcs's user avatar
  • 36.3k
2 votes
Accepted

Is it possible to grant admin permissions via plugins through userPermissions->saveUserPermissions?

This should do the trick... $user->admin = true; That data is part of the UserModel, so be sure to add it before the saveUser call. Being a full-blown admin not technically part of setting ...
Lindsey D's user avatar
  • 24k
2 votes
Accepted

Save user group event in Control panel

It happens here (maybe intended, maybe a bug): https://github.com/craftcms/cms/tree/master-v2/src/controllers/UsersController.php#L1757 For news users $groupIds is an empty string, which means the ...
Oliver Stark's user avatar
2 votes

{% block content %} is a no-go in template/subfolders

In this case, it was just human error and ignorance of how hidden template files work through the CMS. I believed that I should be able to call the hidden file in the browser, via something like "...
Thomas's user avatar
  • 31
2 votes
Accepted

Permissions at field level. Can this be done?

Not natively, but there's the Control Panel Body Classes plugin, which would enable you to add the handle for your "eventeers" User Group as a CSS classname to the <body> tag (i.e. body....
Mats Mikkel Rummelhoff's user avatar
2 votes
Accepted

Permissions needed to "edit image"?

Maybe this is what you are looking for When the deleteFilesAndFoldersInVolume permission is not set, the user cannot edit the image. And dragging files into other folders result in an error.
Robin Schambach's user avatar
2 votes
Accepted

Checking permission for editing entries from inside template

In Craft 3.1, permissions checks are done based on uid now, not id. This should work: {{ currentUser.can('editEntries:'~entry.getSection().uid) }}
Brad Bell's user avatar
  • 67.5k
2 votes
Accepted

RequirePermission not working

You want: {% requirePermission("editSite:#{currentSite.id}") %} The way you have it now, the permission it's checking is the literal string editSite: (currentSite.id) which no one will have ...
andrew.welch's user avatar
  • 11.6k
2 votes

Multiple authors for an entry

We solved it like this... We created a Users field called “Article Authors”, for that Articles section. And there unlimited users could be selected as “Authors” of the entry (for search results, ...
tom's user avatar
  • 465
2 votes

Restricting access to user groups with Control Panel access only

I’ve figured out what I was missing. I needed to use can: {% if currentUser.can('accessCp') ?? false %} :)
Jonathan Schofield's user avatar
2 votes
Accepted

Upload failed, fopen – failed to open stream: Permission denied

This turned out to be an issue with changing permissions on my "root" server. The user/group was then running "root" instead of "serverpilot". Following the documentation on ServerPilot Permissions, ...
Allan's user avatar
  • 41
2 votes

Craft on WSL permissions error

This worked well for me! Be sure to change directory out of the drive you want to unmount first! Just to keep it all together here is what you need to do - sudo nano /etc/wsl.conf Paste this into ...
Steven Hambleton's user avatar
2 votes

“Access Plugin” doesn't appear in Permissions list

If your plugin has a CP section (specifically, the main Plugin class declares a $hasCpSection property, and it’s set to true), you should get an “Access My Plugin Name” option near the top of the ...
August Miller's user avatar
2 votes

“Access Plugin” doesn't appear in Permissions list

The reason was: "hasCpSection": true property was missing from the plugin's composer.json and I had to (composer) remove and require it again in order to see the permission checkmark.
peet86's user avatar
  • 41

Only top scored, non community-wiki answers of a minimum length are eligible