I wanted to know if there's a way to hide list or library row items based on the content of a specific column.
Here is a use case scenario:
I have a list or library of any kind, I have a column called Permissions, within that column I can specify one of two group name types as strings, e.g "Owners" or "Visitors". Afterword, I have conditions that go through each individual row item in the list or library and base the visibility of that row item on the string content of the Permissions column.
Row Visibility Logic Pseudo:
If( current_row.Permissions_Col.Content == LoggedInUser.Group_Name)
Show this row
Else
Hide this row
Is it possible do accomplish this either through the Sharepoint web interface or programmitcally in Sharepoint Designer or Visual Studio?? Insight is appreciated.
UPDATE:
Thanks all for the feedback, just to clarify the motivation for this is our document structure and security/permissions layer is very dynamic, so we can't create a static hierarchy in SharePoint. Instead we want to have one single library pool of resources which are filtered on the fly based on the Group membership of the currently logged in user. We want to treat the Permissions column content as metadata to describe who can view this row's data.
My apologies, but another requirement I neglected to mention is that when the logged-in user tries to upload a file or create a new element (i.e. List, Library, Folder, Form, etc.) in SharePoint, permissions get set automatically for the user's group and for "Owners". The only exceptions to this condition would be "Owners". So the pseudo is something like this:
File Upload / Item Creation Logic:
If( (creatingElement OR uploadingFile) AND LoggedInUser.Group_Name != "Owners")
{
SET Permissions_Col.Content to LoggedInUser.Group_Name;
SET read permissions for LoggedInUser.Group_Name and full control for "Owners";
}