محمد جمعه بتاريخ: 14 أغسطس 2006 تقديم بلاغ مشاركة بتاريخ: 14 أغسطس 2006 تحية طيبة لكل افراد المنتديارجو المساعدة في عمل برنامج ( اعطاء بعض الأفكار ) يعطي للـ Administrator السماحية للمستخدمين Users في فتح الشاشات والتقارير في البرنامج .............. بمعني ان يقوم البرنامج قبل فتح اي شاشة او تقرير بعمل Check على هذا المستخدم User هل مسموح بالفتح ام لا ؟مع العلم انني لدي برنامج يعمل على التقارير يقوم بكتابة الرقم 9999999999.99 باللغه العربية( التفقيط ) .فعلى من يريده ارجو مراسلتي على [email protected]وسوف اقوم بإرساله لمن يرغبشكراً لكم. اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
basilt بتاريخ: 2 سبتمبر 2006 تقديم بلاغ مشاركة بتاريخ: 2 سبتمبر 2006 اعتقد ان هناك طريقتان : 1) اما باعطاء ومنح privilege الشاشة كاملة او اخفائها للمستخدم . 2) على مستوى كل شاشة او تقرير عمل flag معين يعمل check عليه اذا مسموح بالدخول على الشاشة او لا . " واعتقد انه يفضل استخدام الطريقة الاولى لأنها اكثر فعالية and its more professional . اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Mbadawy بتاريخ: 29 أكتوبر 2006 تقديم بلاغ مشاركة بتاريخ: 29 أكتوبر 2006 (معدل) CREATE TABLE users ( user_id NUMBER(10) primary key , user_name VARCHAR2(100) UNIQU, pass_word VARCHAR2(100) NOT NULL,creat_date DATE DEFAULT SYSDATE,locked NUMBER(1) DEFAULT 0 ) ;CREATE TABLE FORMS ( form_id NUMBER PRIMARY KEY ,form_name VARCHAR2(100),from_desc VARCHAR2(300));CREATE TABLE reports( rep_id NUMBER PRIMARY KEY ,rep_name VARCHAR2(100),rep_desc VARCHAR2(300));CREATE TABLE user_forms( user_id NUMBER (10) constraint user_fk references users( user_id),form_id NUMBER constaint form_fk references forms(form_id),status NUMBER(1) DEFAULT 1 -- 1 full access. 2 modify. 3 query only,constraint us_frms_pk primary key (user_id , form_id));CREATE TABLE user_reports( user_id NUMBER (10) constraint user_fk references users( user_id),rep_id NUMBER constaint form_fk references reports(rep_id),constraint us_reps_pk primary key (user_id , rep_id));-- now create the user_app packagecreate or replace package user_appis FUNCTION exist ( user_name_in IN users.user_name%type psw_in IN users.pass_word%type) RETURN BOOLEAN ;function get_id ( user_name_in IN users.user_name%type ) return users.user_id%type ;function can_open_form (user_id_in IN us_forms.user_id%type ,form_id_in IN us_forms.form_id%type) RETURN BOOLEAN ;function can_open_rep (user_id_in IN us_forms.user_id%type ,rep_id_in IN us_forms.form_id%type) RETURN BOOLEAN ;FUNCTION get_form_status (user_id_in IN us_forms.user_id%type ,form_id_in IN us_forms.form_id%type)RETURN CHAR ;end user_app ;/create or replace package BODY user_appis FUNCTION exist ( user_name_in IN users.user_name%type psw_in IN users.pass_word%type) RETURN BOOLEAN IS retval BOOLEAN := FALSE ; exi NUMBER(1) := 0 ; BEGIN SELECT 1 INTO exi FROM users WHERE upper(user_name) = upper(user_name_in) AND upper(pass_word) = upper(psw_in ) ; IF exi = 1 THEN retval := TRUE ; END IF ; RETURN retval ; EXCEPTION WHEN no_data_found THE RETURN FALSE ; END exist ;-------------------------------------------------------------------------------------function get_id ( user_name_in IN users.user_name%type ) return users.user_id%type IS retval users.user_id%type ;BEGIN SELECT user_id INTO retval FROM users WHERE upper(user_name) = upper(user_name_in); RETURN retval ; END get_id ;---------------------------------------------------------------------------function can_open_form (user_id_in IN us_forms.user_id%type ,form_id_in IN us_forms.form_id%type) RETURN BOOLEAN IS retval BOOLEAN := FALSE ; exi NUMBER(1) := 0 ; BEGIN SELECT 1 INTO exi FROM us_forms WHERE user_id = user_id_in AND form_id = form_id_in ; IF exi = 1 THEN retval := TRUE ; END IF ; RETURN retval ; EXCEPTION WHEN no_data_found THE RETURN FALSE ; END can_open_form ;function can_open_rep (user_id_in IN us_forms.user_id%type ,rep_id_in IN us_forms.form_id%type) RETURN BOOLEAN IS retval BOOLEAN := FALSE ; exi NUMBER(1) := 0 ; BEGIN SELECT 1 INTO exi FROM us_reports WHERE user_id = user_id_in AND rep_id = rep_id_in ; IF exi = 1 THEN retval := TRUE ; END IF ; RETURN retval ; EXCEPTION WHEN no_data_found THE RETURN FALSE ; END can_open_rep ;FUNCTION get_form_status (user_id_in IN us_forms.user_id%type ,form_id_in IN us_forms.form_id%type)RETURN CHAR IS retval CHAR ; sts INTEGER ;BEGIN SELECT status INTO sts FROM us_forms WHERE user_id = user_id_in AND form_id = form_id_in ; IF sts = 1 THEN retval := 'F'; ELSIF sts = 2 THEN retval := 'M'; ELSIF sts = 3 THEN retval := 'Q' ; END IF ; RETURN retval ; END get_form_status ;end user_app ;/------------------------------------------------------------------------------------------------------------------------------------------------------------------------after runing the above script you should insert data into the users tableand the forms table and the us_forms and the us_reports .after that it will be used in three steps : 1- on the login screen to check the existance of the user and also to check that the user typed the correct user name and password . ex : in forms builder IF user_app.exist(:us_name , :psw) THEN :global.user_id := user_app.get_id(:us_name); open_form('main'); ELSE message('Wrong user name or password'); raise form_trigger_failure ; END IF ; 2- on the main screen : when the user is going to open any form or report to check that the user can open the specified form or report .ex : IF user_app.can_open_form (:global.user_id, 2) THEN open_form(2); END IF ;3 - while or before opening the form to check the status of the user on the opend form, after that you can specify what the user can do on this form . ex: sts := user_app.get_status(:GLOBAL.user_id , 2) ; IF sts = 'Q' THEN set_block_property('db_block_1',insert_allowed,property_false); set_block_property('db_block_1',update_allowed,property_false); set_block_property('db_block_1',delete_allowed,property_false); END IF ; تم تعديل 29 أكتوبر 2006 بواسطة Mbadawy اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Shibeika بتاريخ: 8 نوفمبر 2006 تقديم بلاغ مشاركة بتاريخ: 8 نوفمبر 2006 هنالك طريقة الـ Security بإستخدام الـ Roles وهي أقل تكلفة في الزمن والمجهودفقط قم بإنشاء Roles وقم بإعطاء الـ Roles الصلاحيات علي جداول النظام اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Mbadawy بتاريخ: 8 نوفمبر 2006 تقديم بلاغ مشاركة بتاريخ: 8 نوفمبر 2006 if you please can you explane with example the roles wayi would like to know itand how to be used in the mneuthanx اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Recommended Posts
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.