How to add role globally in Hasura? - hasura

Does anyone know how to add a new role globally in Hasura?
e.g. an editor role
Someone had set this up on a project I worked on in the past, and I'm curious how to do it.
I need it so any time I add a new table, for the editor role to be automatically show up in the Permissions tab.
Currently I have to go in and add it every time for each new table.

Related

How to programmatically add newly created node to a group in the Drupal Group Module?

I am creating a management website. Super admin can create users. Users can create nodes. I need to know how to add that newly created nodes to the groups that users are in.
The group that you want to say is called roles in Drupal.
For example: When a user creates a node, this user has a role "editor". Then, the node was created by editor.
You can modify the permission from this path. Article: Create new content /admin/people/permissions.
Now, if you want to show the role in the content view, you have to edit the display view /admin/structure/types/manage/article/display and show the author block.

Disable Order item link

Limit User Access
I'm trying to limit user access to not let him edit product data, such as weight, price, measurements...
I installed the Ultimate Dashboard Plugin and even managed to remove this direct access, letting him see only the orders page, because that's what I want him to have access to.
But when you open the order, he can still access the product through the order link.
Please is there any way I can disable this possibility?
You can achieve that by using the User Role Editor plugin. You can create a custom role there and uncheck the "Edit Product" capability.
Once you created the new custom role, you should go to the "All Users" page from the left admin sidebar, then find the user that you want to prevent editing the products and change its role to the new role that you created with the plugin.
Here is the documentation and examples:
http://shinephp.com/user-role-editor-wordpress-plugin/

Drupal 6.x Add More Module - No end to adding more

Simple question for all of you here dealing with Drupal 6.x...
With Drupal's Add More module, is there a way to configure my webform so that there is no limit on how many of a specific fields I can add more of?
Please see my image for example:
For example, I'd like to enable the user to add as many titles as they would like. Is that doable?
Unfortunately, it's not currently possible to add unlimited "add another" functionality with webforms. And if this functionality does become a reality someday, I doubt it will be backported to the Drupal 6 version of the module. From the webform modules author (quicksketch):
there is no progress on this subject. The ability to support multiple
values requires a tremendous amount of re-architecting, including
changes to the way CSVs are generated, analysis, the database
structure, and the UI (both for administrators and users). I wouldn't
expect this feature to be added any time soon.
See this thread for more information:
http://drupal.org/node/354381
I would suggest using a node and the CCK module plus rules and views to collect this information.
Assumptions:
Anonymous users can fill out the current form
You need some way of retrieving the data that is submitted
Regular users of the site should not be able to view submissions
Very loose directions:
Create a content type and add all of the fields that your current webform contains to it. CCK has the ability to store unlimited values out of the box. On the field settings page, inside the Global Settings fieldset, select "Unlimited" for the "Number of Values" field.
Give anonymous users permission to Create [your-new-content-type] Content on the Role Permissions page.
Using the Rules module, create a new triggered rule that fires on "Content is about to be viewed" with an condition "Content has type [your-new-content-type]" and an action of redirect to homepage (or a custom error page that you created). (Note: this is a bit of a performance hit. There are better ways to restrict access to this content type, but for the sake of this tutorial, this was the easiest to explain)
Using the Views module, create a new view with Style set to Table. Add each of the fields in [your-new-content-type] in the fields section. Under "Access" choose "role" and select the role that is assigned to your user. Add a "page" display, give it a Path and save. This is the page you will use to view submissions.
Optional:
Use the Rules module to send yourself (or the submitter) an email when a node of [your-new-content-type] is created.

How I can add "files available for download" to Drupal user profile page

first time here. I have searched all day for my particular issue with no luck.
I have users that have specific roles auto generated (they purchase a game). I want to display files available to their particular role on their user profile page. I just want to know how I can add a generic view or associate a panel with user profile pages. I want this to display for every user, not on a per user basis. Basically it'll act like, say, direct2drive, you log in and go to your user profile basically and see what games you bought. Seems simple but I am having a heck of a time figuring out how to do this.
I am pretty used to using views but I just don't get how to edit the user profiles like I want to.
Thanks!
The simplest way is to install views_attach, and create a view with a Profile display. This displays the View on the user profile pages, rather than on its own page or in a block, and will pass the user's uid to the View as an argument.
Alternatively, if you're already using comfortable using panels, you can go to admin/build/panels and enable the Users panel. This replaces the user profile page with a panel, which you can add views, nodes and blocks to as normal.

Drupal: How to implement a SECOND admin with fewer rights than the normal and own theme?

I'm currently trying to realize a second (lower) admin layer in drupal. I have made an extra section via the module of the same name for those users so they can have their own theme etc. I want to give these second or lower admins a menu in their section of the page where they can access certain admin functions like administer other users, and certain types of content etc. The biggest problem I encounter is security inconsistency, e.g. the second admin could make himself a full admin because I use drupals own core admin functions and where not able to figure out how to permanently block certain features but permit others. In this case I want to make the second admin able to create and change roles of users in lower hierarchy than he himself, but not able to change to or create real admins. This is only a part of the problem however, smaller issue is that I'm not able to keep my theme set for the second admin section without having to duplicate the existing admin views (like those for users and content) and set the duplicates to a path under my section. Any suggestions?
This would probably be best accomplished through creating a role (admin/user/roles) then defining that roles permissions (admin/user/permissions). Then just create a user(admin/user/user/create) belonging to that role, define a menu (admin/build/menu) with the links you want them to have access, then move the menu block (admin/build/block) to the region you want and then configure it for only that specific role.
There isn't exact an easy way to go about this, just a lot of permissions trial and error. I suggest you log in as user/1 in one browser and log in as the user you created with another browser and test the permissions config you've setup.

Resources