Skip to content

Commit

Permalink
minor permissions updates for reconciliation
Browse files Browse the repository at this point in the history
LaTeX escaping for n and m dashes

git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.3@3717 4979c152-3d1c-0410-bac9-87ea11338e46
  • Loading branch information
einhverfr committed Sep 20, 2011
1 parent 10677c5 commit 1bb62e6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LedgerSMB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ sub is_allowed_role {
my ($self, $args) = @_;
my @roles = @{$args->{allowed_roles}};
for my $role (@roles){
$self->{_role_prefix} = "" unless defined $self->{_role_prefix};
$self->{_role_prefix} = "lsmb_$self->{company}__" unless defined $self->{_role_prefix};
my @roleset = grep m/^$self->{_role_prefix}$role$/, @{$self->{_roles}};
if (scalar @roleset){
return 1;
Expand Down
2 changes: 2 additions & 0 deletions LedgerSMB/Template/LaTeX.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ sub escape {

if (defined $vars){
$vars =~ s/([&\$\\_<>~^#\%\{\}])/\\$1/g;
$vars =~ s//--/g;
$vars =~ s/[—―]/---/g;
$vars =~ s/"(.*)"/``$1''/gs;
$vars =~ s/\n/\n\n/gm;
}
Expand Down
3 changes: 2 additions & 1 deletion sql/modules/Roles.sql
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,8 @@ WITH INHERIT NOLOGIN;
GRANT SELECT ON recon_payee
TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";

GRANT UPDATE ON cr_report TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
GRANT DELETE ON cr_report_line TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
GRANT UPDATE, DELETE ON cr_report TO "lsmb_<?lsmb dbname ?>__reconciliation_approve";
GRANT SELECT ON acc_trans, account_checkpoint TO
"lsmb_<?lsmb dbname ?>__reconciliation_approve";

Expand Down
3 changes: 2 additions & 1 deletion t/11-ledgersmb.t
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ like($lsmb->{path}, qr#bin/(lynx|mozilla)#, 'merge: Index 1, left existing key')

# $lsmb->is_allowed_role checks, no prefix
$lsmb = LedgerSMB->new();
$lsmb->{_roles} = ['apple', 'pear'];
$lsmb->{_role_prefix} = '1_';
$lsmb->{_roles} = ['1_apple', '1_pear'];
is($lsmb->is_allowed_role({allowed_roles => ['pear']}), 1,
'is_allowed_role: allowed role');

Expand Down

0 comments on commit 1bb62e6

Please sign in to comment.