PDA

View Full Version : جدول tblUserSecurity_Sec و کنترل دسترسی به دیتا



mohsenna30ri
شنبه 25 آذر 1385, 08:25 صبح
در یکی از برنامه های ام دی ئی جدولی دیدم به این عنوان
tblUserSecurity_Sec
که حاوی فیلدهایی شبیه user, password, read_only, full_access, admin
و از این قبیل بود که می توان حدس زد جهت کنترل دسترسی به دیتای اکسس به یوزرهای مختلف مورد استفاده قرار می گیرد
می خواستم بدونم دوستان اطلاعاتی در این مورد دارند؟ آیا این جدول توسط ویزاردهای خود اکسس ایجاد شده یا بصورت دستی ایجاد می گردد
پیشاپیش از ابراز نظراتتان متشکرم

صبا9841
شنبه 25 آذر 1385, 10:54 صبح
احتمالاً دستی تهیه شده است. به این متن توجه کنید:


Enabling/Disabling controls, based on User Security

In conjunction with using security work groups to limit/permit functionality to individual users, controls may be enabled/ disabled at run time. Otherwise users will have to view a warning message box from Access, when they try to do something they're not allowed to do.
Note that the permission assignments for workgroups are by table, query, form, macro, etc. So this type of routine must be used to 'set - permissions' for individual controls. As in the example below, "viewers" must have permission to see the mainswitch board form, but it is necessary to disable buttons on that form.
To do this:
• create a table with username (key) and workgroup
• create a usersform (autoform is good enough) based on table
• open form in autoexe (hidden) to where condition [username]=CurrentUser()
• set values of controls with On Open property based on usergroup.
For example:
• If mainswtich board form has buttons to add, edit and report on records,you may set up a workgroup of accounts that may only report, called viewers.
• To disable the add and edit buttons use the OnOpen property of the mainswtich board form to run the following:
• if condition: [Forms]![usersform]![workgroup]="viewers"

• setvalue: [Forms]![mainswitch]![reportsbutton].[Enabled] Yes
• [Forms]![mainswitch]![addbutton].[Enabled] No
[Forms]![mainswitch]![editbutton].[Enabled] No
This will 'gray-out' and disable the add and edit buttons

mohsenna30ri
شنبه 25 آذر 1385, 11:52 صبح
آیا شما برنامه ای که حاوی جدول فوق باشد در اختیار دارید؟ بصورتی که عملا از اون استفاده شده باشد

صبا9841
شنبه 25 آذر 1385, 16:02 عصر
فعلاً که خیر، در حین جستجوی همین موضوع به این نوشته رسیدم تا اینکه شما موضوع جدول را مطرح کردید و به یاد دستور اتش افتادم و برایتان فرستادم تا شاید بکارتان بیاید. اگر برنامه عملی هم دیدم حتما تقدیم میشود.:متفکر: