Main > Forum > 1C:Enterprise Platform > 1C:Query language and DCS > Manage User Filter,ConditionalAppear, Group, Field Restrictions By Script

Forum

Search UsersRules
Manage User Filter,ConditionalAppear, Group, Field Restrictions By Script
#1
Interested
Points:: 0
Joined:: Apr 5, 2012

Hi,

I have a Report. report works on DCS. In that schema as usually some fileds are restrcited completely (as attibute and as field). So in default this fields do not viewed or not available completely in filter, grouping etc.

But, I want to manage this proccess by script. According to users works, I have to manage this proccess. For example, sometimes A1 field must be restricted, sometimes not.

Code
Procedure ManageRestriction(Report,Restrict,FieldName,FieldDescription,FieldValueType) Export 
   
   Schema = GetFromTempStorage(Report.SchemaID);
   
   SchemaFields = Schema.DataSets.DataSet1.Fields;
   
   EkSütun_S = SchemaFields.Find(FieldName);
   
   If TypeOf(EkSütun_S) = Type("DataCompositionSchemaDataSetField") Then
      
      EkSütun_S.AttributeUseRestriction.Condition   = Restrict;
      EkSütun_S.AttributeUseRestriction.Field   = Restrict;
      EkSütun_S.AttributeUseRestriction.Group   = Restrict;
      EkSütun_S.AttributeUseRestriction.Order   = Restrict;
      
      EkSütun_S.UseRestriction.Condition   = Restrict;
      EkSütun_S.UseRestriction.Field   = Restrict;
      EkSütun_S.UseRestriction.Group   = Restrict;
      EkSütun_S.UseRestriction.Order   = Restrict;
      
      EkSütun_S.Title = FieldDescription;
      EkSütun_S.ValueType = FieldValueType;
      
   EndIf; 
   
   Report.SettingsComposer.Initialize(New DataCompositionAvailableSettingsSource(Schema));      
   Report.SettingsComposer.Refresh(DataCompositionSettingsRefreshMethod.Full);
   
   PutToTempStorage(Schema,Report.SchemaID);
   
EndProcedure


I thought that it would work, but not. Or initializing of settings composer is not enough?

Profile
#2
Interested
Points:: 0
Joined:: Apr 5, 2012

Or while initializing composer, platform as source takes query? Editing fiels of dataset is not enough?

Profile
#3
Guest
Points::
Joined::

Good morning!

Am I right that you want to hide some columns from the report depending on the user access rights?

Profile
#4
Interested
Points:: 0
Joined:: Apr 5, 2012

Yeap, you are right. But not only hide, DCS reports there is good property that user can create own report variants. I want to hide in variant editing mode too.

Profile
#5
Interested
Points:: 0
Joined:: Apr 5, 2012

As option, I can change each time query text. But I do not want to do this because, query text is a little bit different. For example, there is columns named c1, c2, c3 - this columns have types more than one. According to users work - synonyms, valuetypes and visiblity of that columns change only.

Profile
#6
Guest
Points::
Joined::

It is better to provide users with different rights different variants of your report. Thus you can set an access using built-in Roles feature.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.