How to restrict other user group members to view the Documents - liferay-6

I have created an Organization which has four user groups. I want to restrict the user group to view the file uploaded by the other user group.
i.e
Organization 1
User Group 1
A
B
User Group 2
C
D
User Group 3
E
F
User Group 4
G
H
I am using CustomLanding hook to land on the organization page.
From above, If A uploads a document, it can be viewed only by B in user group 1.
Like the same I want to restrict the viewable condition to other groups also.
Please guide me to achieve this.
Regards,
Dinesh.

you can create different roles for the user and apply permission for role.
Instead of taking as user group with in organization we have teams. you can try with teams.

Related

How to merge groups permissions in aem for user

How can merged multiple groups permissions for user
product1,product2,product3 pages is not displaying to user, if user is part of Goups A,B,C
Group A has below paths permissions-->
content/abc/product1 **allow**
content/abc/product2 **deny**
content/abc/product3 **deny**
Group B has below paths permissions-->
content/abc/product1 **deny**
content/abc/product2 **allow**
content/abc/product3 **deny**
Group C has below paths permissions-->
content/abc/product1 **deny**
content/abc/product2 **deny**
content/abc/product3 **allow**
I want to display product1,product2,product3 if user is part of Goups A,B,C

how do I list all teams owned by a user

Is it possible (with powershell) to list all the teams groups where one person is owner of?
For example user A is owner of several Teams (that i know).
How do i list this up in Powershell?
I would want a list of all teams groups where one of the owners is that specific user A.
I tried figuring it out but can't...
Tried for a loop to check all groupids but i can only list members of output every teams with their owners... I only wish to see the teams where user A is one of the owners
thanks : )

TYPO3 default group ownership

TYPO3 9.5.22
I have a TYPO3 based site with a number of department related subtrees, D1, D2, D3.
Users of department D1 are in backend group D1 and can work in the D1 Subtree via a DB mount.
Users of department D2 are in backend group D2 and can work in the D2 Subtree via a DB mount.
If a user U1D1 (Member of Group D1) creates a page in the D1 subtree, the page group owndership by the "admins" group.
This means that U2D1 can not edit pages of U1D1.
What do I have to do so pages created by U1D1 belong to group D1 instead of admins?
Any help would be greatly appreciated.
Usually, a new page would get the main usergroup of a user (probably "admin" in your case).
You can override that by setting TCEMAIN.permissions.groupid in PageTS on the specific pagetree. https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/TceMain.html#groupid
Don't hesitate to ask if you are unsure how to add it for a specific page tree.
You can use the TYPO3 mechanism for setting default values for single fields of a record. in this case the records are pages and the default value in question is the group the page should belong to.
In case you have a complex system of user groups where multiple groups should be able to share access to the same pages it's helpful to introduce a helper group which is subgroup of the groups assigned to the users (typical for LDAP connections). in this way you have groups which own the pages, and multiple parent groups which include the owner groups.
As new pages are assigned the primary user group by default, you end up in a chaos which pages can be edited by which user. Especially if admins are involved too. Here it is necessary to assign clearly the owner group to any new pages.
more Info on the settings can be found in this SQ answer:
https://stackoverflow.com/a/60072878/6796354
You can adjust the ownership and access rights on the access-page

Get each user role in PostgreSQL

Suppose I have a DB and in this DB I have a users table and a groups table where each user is related to a specific group.
In the groups table we have a “data entry” group, a “reviewer” group, an “approver” group etc.
Now assume a user X. This user is added to the “data entry” group and also added to the “reviewer” group, that means the user X has both access rights: data entry and reviewer.
Y is another user who has the “data entry” access right, so when I want to generate a report to get the count for each user and group, the “data entry” user and the “data entry + reviewer” user must be counted separately.
The point here is that those users which belong to both groups must not be counted in the individual groups; for example the “data entry + reviewer” user must not be counted to the “data entry” group.
I'd aggregate twice - first, for each user get all the groups he or she belongs too, and then aggregate that result and count how many each combination appears:
-- Count how many times each combination occurs
SELECT group_combinataions, COUNT(*)
FROM (-- Get the groups for each user
SELECT STRING_AGG(group_name ORDER BY group_name) AS group_combinations
FROM groups
GROUP BY userid) t
GROUP BY group_combinations

How to get group info of a user

I get a user's JID,i want to get the group info that the user has joined by user JID.
Can someone help me ?Please.
Depending on which storage type you are using in there (CoreData/Memory) - the 'groups' field on the user (XMPPUserCoreDataStorageObject) is a 1:m relation to the groups (XMPPGroupCoreDataStorageObject) of that user, and each group also has a 1:m relation to users (group.users).
So you should be able to get the user object via the jid of that user ([xmppRosterStorage userForJID:jid ...]), and from there, get the groups (user.groups).