Home > Forum > Rules, JS, SQL > Visibility of report rows and list of instances on application home page

Visibility of report rows and list of instances on application home page
0

I've got a contract database workflow. One of the fields on the form is Project/Department field which is the same as user department in AD users list. Two users: Adam and his boss John. Is it possible to:
1. show in the report only these records, where current user login (account) department is equal to Project/Department felds.
2. on the app home show instances not only created by the current user but all instances created by John's team? At he moment John is seeing Adam's data but this not working in the other way arround,
3. So I'd like to achieve the visibility based on the AD group membership, than on the user login and / or its manager.

MVP

Hi Przemysław,

if the other users shouldn’t get a glimpse of the other instances I don’t see an other option than working with privileges.
With glimpse I mean result in the archive/search structure or the search.
If this would be fine, you could grant everyone read permissions to all instances and use the sql filter on the first tab of the report to filter the department of the current user. In the Form you could execute a hyperlink action if the current user is not in the department of the selected instance to redirect the user.

If you want to work with privileges and those are actual AD Groups you could test whether the granting the AD groups read permission would be fine. I noticed that in one of the previous version the membership of groups was resolved at runtime in BPS groups.
I think it worked also on workflow instance privilege level.
If these are not AD Groups you could opt for BPS groups.
Worst case, create a “department” process with a member field/item list and update the privileges of all workflow instances when the membership changes. I have used this also in a contract process and it worked fine, also I didn’t really liked it.

Best regards,
Daniel

In reply to: Daniel Krüger (Cosmo Consult)

Hi Przemysław,

if the other users shouldn’t get a glimpse of the other instances I don’t see an other option than working with privileges.
With glimpse I mean result in the archive/search structure or the search.
If this would be fine, you could grant everyone read permissions to all instances and use the sql filter on the first tab of the report to filter the department of the current user. In the Form you could execute a hyperlink action if the current user is not in the department of the selected instance to redirect the user.

If you want to work with privileges and those are actual AD Groups you could test whether the granting the AD groups read permission would be fine. I noticed that in one of the previous version the membership of groups was resolved at runtime in BPS groups.
I think it worked also on workflow instance privilege level.
If these are not AD Groups you could opt for BPS groups.
Worst case, create a “department” process with a member field/item list and update the privileges of all workflow instances when the membership changes. I have used this also in a contract process and it worked fine, also I didn’t really liked it.

Best regards,
Daniel

Hi Daniel, thank for quick response. Unfortunately I still have a problem with SQL filter. How to combine the condition Project/Department field value is equal to one of the elements of the collection of the AD groups (user can be a member of more than one AD group) from (as I understand) dbo.CacheOrganizationStructure table, [COS_AD_memberOf] column - the user belongs to.

Przemek

MVP
In reply to: Przemysław Wrzesiński

Hi Daniel, thank for quick response. Unfortunately I still have a problem with SQL filter. How to combine the condition Project/Department field value is equal to one of the elements of the collection of the AD groups (user can be a member of more than one AD group) from (as I understand) dbo.CacheOrganizationStructure table, [COS_AD_memberOf] column - the user belongs to.

Przemek

Hi Przemek,


you can use the below filter, at least if the ID of your department field equals the BpsID. Otherwise you need to check the values.
The filter condition will get the BpsId of all groups of which the currentuser is a member and than it will be checked, whether the Id of the Department, WFD_AttChoose5) in my case, is an element of this collection.
Remark: Don't get rid of the rtrim, a space will be added to any used variable. This doesn't hurt with column names, but if the variable is used in a string it makes a different whether you search for AttText1 = 'my value'
or AttText1 = 'my value '
The rtrim will remove the trailing space.
This is just one of those issues, if you don't fix it in the beginning, it won't get fixed. On the other hand, we may have chances with BPS 2023. :)

Best regards,
Daniel

and (dbo.ClearWFElemId(WFD_AttChoose5 ) in
(
SELECT groups.COS_BpsID /*, groups.COS_DisplayName, groups.COS_AccountType, groups.COS_GroupType, groups.COS_ProviderType*/
FROM
[CacheOrganizationStructure] as groups
join [CacheOrganizationStructureGroupRelations] groupRelations on
groups.COS_ID = groupRelations.COSGR_GroupID
join [CacheOrganizationStructure] as users on
users.COS_ID = groupRelations.COSGR_UserID
and users.COS_BpsID = rtrim('##currentloginname## ')

)
)

In reply to: Daniel Krüger (Cosmo Consult)

Hi Przemek,


you can use the below filter, at least if the ID of your department field equals the BpsID. Otherwise you need to check the values.
The filter condition will get the BpsId of all groups of which the currentuser is a member and than it will be checked, whether the Id of the Department, WFD_AttChoose5) in my case, is an element of this collection.
Remark: Don't get rid of the rtrim, a space will be added to any used variable. This doesn't hurt with column names, but if the variable is used in a string it makes a different whether you search for AttText1 = 'my value'
or AttText1 = 'my value '
The rtrim will remove the trailing space.
This is just one of those issues, if you don't fix it in the beginning, it won't get fixed. On the other hand, we may have chances with BPS 2023. :)

Best regards,
Daniel

and (dbo.ClearWFElemId(WFD_AttChoose5 ) in
(
SELECT groups.COS_BpsID /*, groups.COS_DisplayName, groups.COS_AccountType, groups.COS_GroupType, groups.COS_ProviderType*/
FROM
[CacheOrganizationStructure] as groups
join [CacheOrganizationStructureGroupRelations] groupRelations on
groups.COS_ID = groupRelations.COSGR_GroupID
join [CacheOrganizationStructure] as users on
users.COS_ID = groupRelations.COSGR_UserID
and users.COS_BpsID = rtrim('##currentloginname## ')

)
)

Ensure visibility of report rows and list of instances on the application's home page for easy access and reference. This enhances user experience by providing quick access to crucial data, https://storysaver.page/ fostering efficiency in navigating the application. Clear presentation of report rows and instances facilitates seamless interaction with the application, empowering users to make informed decisions based on readily available information.