How to Apply a "Global" Filter?

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Jul 20, 2011
Company:

There is a common infobase working in the 8.2 Thin Client Mode. Many branches are working in it. I need to make every branch to see only documents and catalogs which are assigned to this branch. Many objects have a Branch attribute.
The problem is that there are many configuration objects which have this attribute and many forms are involved. Is there a solution easier, than applying filters to all ListForms?

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Jul 20, 2011
Company:

It was easier than I thought: I even had not to create a RestrictionTemplate.
Open a context menu of Roles configuration objects group and choose All Access Restrictions menu item. Create a new restriction. On the left side (Objects) choose all Catalogs and Documents (without of Sequences). On the right side (Roles) choose a role of branch users. Click Next button. Choose a right Read and a field Branch. Now in the field Access Restriction write a restriction

Code
WHERE Branch = &CurrentBranch

The CurrentBranch should be created and set in SessionParameters. Now the greatest thing: when you click OK this restriction will be copied to all previously chosen objects. Some objects which do not have a Branch field are easy to find and delete: they have in Margins column <Other Fields> value.
Now we have filters by branches and it took about 5 minutes when you know how to do it!
Thanks to everybody!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.