Editing Content in Drupal - drupal

I have an instance of Drupal (Version 9) installed on my local machine.
I want to add users to "Groups" such as "Department X", "Department Y" etc.
This is what I am trying to achieve:
Department X
userA (role - editor)
userB (role - editor)
Department Y
userC (role - editor)
userD (role - editor)
I want users within the same department to be able to edit each other's content. For example: "userA" & "userB" can edit each other's content but not the content authored by "userC" or "userD".
How can I achieve this?
Thanks in advance for the help!!

STEP 1: You have to aggregate the roles departmentX and departmentY.
STEP 2: Add the specific role to the user.
STEP 3: Finally you can edit all permission.
The users should be like this:
Department X
- userA (role - [editor, departmentX])
- userB (role - [editor, departmentX])
Department Y
- userC (role - [editor, departmentY])
- userD (role - [editor, departmentY])

There is a "Group" module that answers my question.
https://www.drupal.org/project/group

Related

Record set-up in a page in PeopleSoft

Wanted to ask if someone here knows how to set-up records as prompt table in pages through PeopleSoft.
So I have this EXT_ORG_ID (External Org ID Field) in my Level 0, and an ACCOUNT (Account Number) field in my level 1.
Now my ACCOUNT field has a prompt table named TP_ORG.
Inside TP_ORG are 6 fields:
EXT_ORG_ID
ACCOUNT
EFFDT
EFF_STATUS
DESCR
DESCR254
where EXT_ORG_ID, ACCOUNT and EFFDT are my keys. EXT_ORG_ID as the highest key.
Now it is my understanding that given that EXT_ORG_ID is a key to TP_ORG that it should show some results in my prompt table TP_ORG,
The problem is that it doesn't pull any. It doesn't even show the EXT_ORG_ID value in the level 0.
I dont know if this is enough information to give but can anyone help me about this?
Thanks

Drupal 6: How to create a view which displays all articles written by all members of a group

I want to create a view which displays all articles written by all members of that group. How to accomplish this in drupal 6?
Add filters to view.
1) User: Roles / Is one of / Select group of members
2) Node: Type (if you need to specify content type)

How to assign contact Role by code?

I have to assign a Role for a Customer?
I am creating a Customer, after that, for creating a role,
I have already the contact in GlobalAddressBook , I want to add a ROLE for this contact, I don't wanto to create a new record in DirPartyTable.
I use this code:
DirPartyRelationship::createRecordRelations("Vendor" , CompanyInfo::find().RecId , this.findDirPartyRecid().RecId , curext());
I created a record on Table DirPartyRelationship , but on GlobalAddress form (in HomePage) I can't find the new role for my Vendor.
I sow some classes : DirParty , and nother, but I don't know how to use? If I have to use.
Is there a class for creating a role by code? I don't know how I to do this.
Thanks all,
Enjoy!
I appreciate your help!!
I found one of the possible solution.
If I already have a contact (example Vendor o Customer)
I have to take its value in field Party and use this value forcing in the same field in the Cust/Vend Table.
Exaple: if I have a Customer, go on VendTable, I take the value in Party field.
When I create in CustTable my new Customer I force the value taken into in VendTablein field CustTable.Party.
Automatically when I create a customer create a new role, with this system associate a Role.(for my Company).
If you have more information updated my answer.
Thanks all!
References:
https://community.dynamics.com/ax/f/33/t/170776 ;
https://community.dynamics.com/ax/f/33/t/174210?pi51736=1#responses ;
https://msdn.microsoft.com/en-us/library/vendtable.aspx .

How to add additional field to drupal organic group 'User and Group' relation?

Im using Drupal Organic group module and I want to create a group and need to assign users (filter by perticular role) to that group. I have done that part easily but the problem is that, I need to add aditional note on per each group user relation.
Lets say there is a group called "School Prefects" and need to add users to that group whos role is student. In here I need to put a small description for each relation.
Please help me to figure this out.
Thanks in advance.
I will probably deal with the same problem soon.
I think a possible workaround is to use the relation module and
the rules module. You could set up a rule to create a relation
each time a user is assigned to a group, or something like that.
Relations made by the relation module are fieldable. But it would be
maybe better to add a field to the og user-group relation directly.
Update: now that I tackled the issue, I have a different solution. We don't need to add new relations, the og_membership shipped standard with og is all that we need. This is how I did it.
I created a new membership type from admin/config/group/group-membership. It's a fildable entity so I added the required fields: in your case it will be "description".
Then I changed the used membership type per user, I did it in admin/config/people/accounts/fields/og_user_node (I needed to change the field "group membership" in user account).
So, now when you (or a group administrator) go to "manage group page" (clicking the group tab in group node), where you can add new people or manage members, either way you can edit your custom field "description" on each membership users-group.
Besides, you can clone the "og members" view adding the field "description", so in people panel in the group homepage we see name + description.
I my use-case I had to see (per group member): name, role, start date, end date. E.g. John Doe, president, from 1997 to 2003.

Plone 4: List members that have been given Reviewer role on a specific folder

I've created a new view for a folder (based on Tabular view) the only the Title and Date for regular viewers, but if the logged in user had the "Editor" role, it shows an additional column. That column needs to list the users who have been given "Reviewer" role to that specific item. For instance, the columns would be:
Title | Date | (Reviewers)
Folder 1 | 10/04 | Johnny, Steve, Mary Sue
Folder 2 | 10/13 | Sam, Betty, Johnny
I've been able to hide/show the final column based on the authenticated user's role, but I can't seem to figure out how to list just the users who have reviewer access. I've tried using searchForMembers(), but in addition to being very slow, I can only get it to echo the entire list of Members, or narrowed based on site-wide roles, but I need to get just people who have been manually given Reviewer role on the specific folder.
Here's the code for the entire column:
<td tal:define="is_manager python:test(here.portal_membership.getAuthenticatedMember().has_role('Manager'), 1, 0);"
tal:condition="is_manager">
<tal:block tal:define="results python:item.portal_membership.searchForMembers(roles=['Member']);">
<tal:block tal:condition="results"
tal:repeat="user results">
<tal:block tal:define="fullname python:user.getProperty('fullname')">
<span tal:replace="fullname">Full Name</span><span>, </span>
</tal:block>
</tal:block>
</tal:block>
</td>
It works when I have roles=['Member'], but if I change it to "Reviewer" I get nothing - I think because nobody is assigned as a Reviewer for the entire site, only for specific items. I've also tried using .listMembers() in various ways, but it seems that's restricted and I can't use it in the page template. Is there a way around this, or is this the "wrong way" to go about this in the first place?
I've answered to a nearly identical question 2 day ago:
List folders that a user has Reviewer access to in Plone 4
the updated code should look like this:
from Products.CMFCore.utils import getToolByName
portal_url = getToolByName(context, "portal_url")
portal = portal_url.getPortalObject()
acl_users = portal.acl_users
res = []
local_roles = acl_users._getLocalRolesForDisplay(context)
for name, roles, rtype, rid in local_roles:
if 'Reviewer' in roles:
res.append((name,roles,rtype,rid))
I'd suggest to put this kind of logic in the file python and not in the page template.

Resources