Skip to main content
Question

Block certain user groups posting with certain Tasks

  • March 4, 2026
  • 2 replies
  • 22 views

Forum|alt.badge.img

Is it possible to only allow certain roles to post with a specific Task? We want certain users to only be able to post using Task ‘80’ in our system for example.

2 replies

Forum|alt.badge.img+9
  • Captain II
  • March 4, 2026

I don’t believe this is possible with restrictions like access rights or row-level security.

 

You could do this via customisation something like this would work:

public static bool IsUserRole(string roleName, PXGraph graph)
{
string usrName = graph.Accessinfo.UserName;

UsersInRoles assignedRoles = SelectFrom<UsersInRoles>.
Where<UsersInRoles.username.IsEqual<P.AsString>.
And<UsersInRoles.rolename.IsEqual<P.AsString>>>.View.Select(graph, usrName, roleName);
if (assignedRoles == null)
return false;

else return true;
}

//I am not 100% sure of the field name here.
protected virtual void _(Events.FieldUpdated<CRActivity.category> e, PXFieldUpdated b)
{
CRActivity row = e.Row;
if (row == null)
return;

if (IsUserRole("someUserRole", Base))
return;
else
e.Cache.RaiseExceptionHandling<CRActivity.category>(row, new PXSetPropertyException<CRActivity.category>("Priority is required"));
}

 


Forum|alt.badge.img
  • Author
  • Freshman I
  • March 4, 2026
It would be the Project Task field (TaskID) on Journal Transactions

So basically for the role GL Clerk we want them only to be able to use Task ‘80’ only (can still view other task IDs but only remove hold for task 80