Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Script to write for employee salary Post 303046331 by amitmahida on Friday 1st of May 2020 02:43:17 AM
Old 05-01-2020
Script to write for employee salary

the effect of changing the value of PATH to: .:/usr/della/bin: /bin: /usr/bin??

Last edited by amitmahida; 05-01-2020 at 05:30 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Should I write a PERL Script or Shell Script?

Hello, I have done some BASIC shell scripting/PERL scripting before so I am familiar with the languages. I am not really sure which one would lend itself better to the application I have to write. I am required to scan the message logs for possible break in attempts. If I use shell scripting... (2 Replies)
Discussion started by: mojoman
2 Replies

2. What is on Your Mind?

do mind posting ur salary, location(not detailed), job field, work years here

do mind posting ur salary, location(not detailed), job field, work years here I dont you whether you guys are from different countries...but i guess most of you are from different countries, but all in all, we are acting as an ITer.... I just wanto know more about you never mind:p (0 Replies)
Discussion started by: macroideal
0 Replies

3. What is on Your Mind?

AIX Admin Salary

I am interested how much is average AIX Admin Salary.. in the USA or in the EUROPE.. or somewhere else... ;) (6 Replies)
Discussion started by: wwwzviadi
6 Replies

4. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

5. What is on Your Mind?

Monthly Salary in India for Web Programmer?

Anyone know the normal and average monthly salary (and hourly wage for part time) for a solid Web Development in India? Basic requirements. LAMP (Linux, Apache, MySQL, PHP), HTML, CSS, Javascript. vBulletin a plus, but not necessary. Anyone have any idea? (5 Replies)
Discussion started by: Neo
5 Replies

6. What is on Your Mind?

Fresher Salary Details for Redhat Certified System Administrator

I am thinking of doing Redhat certified system Administrator Course(RHCSA).what is the salary details after doing this course in india,Singapore? (0 Replies)
Discussion started by: rajesh1986
0 Replies

7. Shell Programming and Scripting

Employee records

If there are 2 records for an Employee, How can I choose the one with eff_status = ‘Active' and ignore the eff_status ='Terminated'. if there is only one record, then just write that record regardless of the eff_status. Please assist. (1 Reply)
Discussion started by: Harimalyala
1 Replies

8. Linux

Linux admin salary in the USA

Hello guys, First I apologize for asking non technical question but I am goging to move to the USA and I have 8 year experience as a senior linux admin, I am administering storage subsystems as well. Can you please tell me how much is an average salary for Linux admins? Thanks in advance. (4 Replies)
Discussion started by: Vit0_Corleone
4 Replies

9. Shell Programming and Scripting

Calculate the performance of employee

Hi Guys, I need to determine the employee performance and calculate their salaries based on each quarter Expected output enter the no. of Employee 2 2 Enter Employee Name sam Enter salary 1000 Enter Q1 5 Enter Q2 6 Enter Q3 3 Enter Q4 5 Enter Employee Name anderson Enter salary... (17 Replies)
Discussion started by: rohit_shinez
17 Replies
Apache2::SiteControl::PermissionManager(3pm)		User Contributed Perl Documentation	      Apache2::SiteControl::PermissionManager(3pm)

NAME
Apache2::SiteControl::PermissionManager - Rule-based permission management SYNOPSIS
use Apache2::SiteControl::PermissionManager; $manager = new Apache2::SiteControl::PermissionManager(); $rule1 = new SomeSubclassOfSiteControl(); $manager->addRule($rule1); ... $user = new SomeUserTypeYouDefineThatMakesSenseToRules; if($manager->can($user, $action, $resource)) { # OK to do action } # For example if($manager->can($user, "read", "/etc/shadow")) { open DATA, "</etc/shadow"; ... } DESCRIPTION
This module implements a user capabilities API. The basic idea is that you have a set of users and a set of things that can be done in a system. In the code of the system itself, you want to surround sensitive operations with code that determines if the current user is allowed to do that operation. This module attempts to make such a system possible, and easily extensible. The module requires that you write implementations of rules for you system that are subclasses of Apache2::SiteControl::Rule. The rules can be written to use any data types, which are abstractly known as "users", "actions", and "resources." A user is some object that your applications uses to identify the person operating the program. The expectation is that at some point the application authenticated the user and obtained their identity, and the rest of the application is merely applying a ruleset to determine what that user is allowed to do. In the context of the SiteControl system, this user is a Apache2::SiteControl::User or subclass thereof. An action can be any data type (i.e. simply a string). Again, it is really up to the code of the rules (which are primarily written by you) to determine what is valid. The overall usage of this package is as follows: 1. Decide how you want to represent a user. (i.e. Apache2::SiteControl::User) 2. Decide the critical sections of your code that need to be protected, and decide what to do if the user doesn't pass muster. For example if a screen should just hide fields, then the application code needs to reflect that. 3. Create a permission manager instance for your application. Typically use a singleton pattern (there need be only one manager). In the SiteControl system, this is done by a ManagerFactory that you write. 4. Surround sensitive sections of code with something like: if($manager->can($user, "view salary", $payrollRecord)) { # show salary fields } else # hide salary fields } 5. Create rules that spell out the behavior you want and add them to your application's permission manager. The basic idea is that a rule can grant permission, or deny it. If it neither grants or denies, then the manager will take the safe route and say that the action cannot be taken. Part of the code for the rule for protecting salaries might look like: package SalaryViewRule; use Apache2::SiteControl::Rule; use Apache2::SiteControl::User; use base qw(Apache2::SiteControl::Rule); sub grants { $this = shift; $user = shift; $action = shift; $resource = shift; # Do not grant on requests we don't understand. return 0 if(!$user->isa("Apache2::SiteControl::User") || !$this->isa("Apache2::SiteControl::Rule")); if($action eq "view salary" && $resource->isa("Payroll::Record")) { if($user->getUsername() eq $resource->getEmployeeName()) { return "user can view their own salary"; } } return 0; } Then in your subclass of ManagerFactory: use SalaryViewRule; ... $viewRule = new SalaryViewRule; $manager->addRule($viewRule); METHODS
can(user, action verb, resource) This is the primary method of the PermissionManager. It asks if the specified user can do the specified action on the specified resource. For example, $manager->can($user, "eat", "cake"); would return true if the user is allowed to eat cake. Note that this gives you quite a bit of flexibility, but at the expense of strong type safety. It is suggested that all of your rules do type checking to insure that a rule is properly applied. SEE ALSO
Apache2::SiteControl::Rule, Apache::SiteControl::ManagerFactory, Apache2::SiteControl::UserFactory, Apache::SiteControl AUTHOR
This module was written by Tony Kay, <tkay@uoregon.edu>. COPYRIGHT AND LICENSE
perl v5.14.2 2006-03-17 Apache2::SiteControl::PermissionManager(3pm)
All times are GMT -4. The time now is 09:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy